GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSkyDirs Class Reference

Sky directions container class. More...

#include <GSkyDirs.hpp>

Inheritance diagram for GSkyDirs:
GContainer GBase

Public Member Functions

 GSkyDirs (void)
 Void constructor. More...
 
 GSkyDirs (const GSkyDir &dir)
 Single sky direction constructor. More...
 
 GSkyDirs (const GSkyDirs &dirs)
 Copy constructor. More...
 
virtual ~GSkyDirs (void)
 Destructor. More...
 
GSkyDirsoperator= (const GSkyDirs &dirs)
 Assignment operator. More...
 
GSkyDiroperator[] (const int &index)
 Return reference to sky direction. More...
 
const GSkyDiroperator[] (const int &index) const
 Return reference to sky direction (const version) More...
 
void clear (void)
 Clear sky directions container. More...
 
GSkyDirsclone (void) const
 Clone sky directions container. More...
 
std::string classname (void) const
 Return class name. More...
 
GSkyDirat (const int &index)
 Return reference to sky direction. More...
 
const GSkyDirat (const int &index) const
 Return reference to sky direction (const version) More...
 
int size (void) const
 Return number of sky directions in container. More...
 
bool is_empty (void) const
 Signals if there are no sky directions in container. More...
 
GSkyDirappend (const GSkyDir &dir)
 Append sky direction to container. More...
 
GSkyDirinsert (const int &index, const GSkyDir &dir)
 Insert sky direction into container. More...
 
void remove (const int &index)
 Remove sky direction from container. More...
 
void reserve (const int &num)
 Reserves space for sky directions in container. More...
 
void extend (const GSkyDirs &dirs)
 Append sky directions container. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print sky directions container information. More...
 
- Public Member Functions inherited from GContainer
virtual ~GContainer (void)
 Destructor. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GSkyDirs &dirs)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

std::vector< GSkyDirm_dirs
 List of sky directions. More...
 

Detailed Description

Sky directions container class.

This class is a container for sky directions. Sky directions are implemented by the GSkyDir class.

Definition at line 49 of file GSkyDirs.hpp.

Constructor & Destructor Documentation

GSkyDirs::GSkyDirs ( void  )

Void constructor.

Constructs empty sky directions container.

Definition at line 67 of file GSkyDirs.cpp.

References init_members().

Referenced by clone().

GSkyDirs::GSkyDirs ( const GSkyDir dir)
explicit

Single sky direction constructor.

Parameters
[in]dirSky directions.

Constructs sky directions container from a single sky direction.

Definition at line 84 of file GSkyDirs.cpp.

References append(), and init_members().

GSkyDirs::GSkyDirs ( const GSkyDirs dirs)

Copy constructor.

Parameters
[in]dirsSky directions.

Construct sky directions container by copying from another sky directions container.

Definition at line 105 of file GSkyDirs.cpp.

References copy_members(), and init_members().

GSkyDirs::~GSkyDirs ( void  )
virtual

Destructor.

Definition at line 121 of file GSkyDirs.cpp.

References free_members().

Member Function Documentation

GSkyDir & GSkyDirs::append ( const GSkyDir dir)

Append sky direction to container.

Parameters
[in]dirSky direction.
Returns
Reference to appended sky direction.

Appends sky direction to the container by making a deep copy of the sky direction.

Definition at line 232 of file GSkyDirs.cpp.

References m_dirs, and size().

Referenced by GHealpix::boundaries(), and GSkyDirs().

GSkyDir & GSkyDirs::at ( const int &  index)
inline

Return reference to sky direction.

Parameters
[in]indexSky direction index [0,...,size()-1].
Exceptions
GException::out_of_rangeSky direction index is out of range.

Returns a reference to the sky direction with the specified index.

Definition at line 141 of file GSkyDirs.hpp.

const GSkyDir & GSkyDirs::at ( const int &  index) const

Return reference to sky direction (const version)

Parameters
[in]indexSky direction index [0,...,size()-1].
Exceptions
GException::out_of_rangeSky direction index is out of range.

Returns a reference to the sky direction with the specified index.

Definition at line 211 of file GSkyDirs.cpp.

References G_AT, m_dirs, and size().

std::string GSkyDirs::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GSkyDirs").

Implements GBase.

Definition at line 95 of file GSkyDirs.hpp.

void GSkyDirs::clear ( void  )
virtual

Clear sky directions container.

Removes all sky directions from the container.

Implements GBase.

Definition at line 175 of file GSkyDirs.cpp.

References free_members(), and init_members().

GSkyDirs * GSkyDirs::clone ( void  ) const
virtual

Clone sky directions container.

Returns
Pointer to deep copy of sky directions container

Makes a deep copy of the sky directions container instance.

Implements GBase.

Definition at line 195 of file GSkyDirs.cpp.

References GSkyDirs().

void GSkyDirs::copy_members ( const GSkyDirs dirs)
protected

Copy class members.

Parameters
[in]dirsSky directions container.

Definition at line 400 of file GSkyDirs.cpp.

References m_dirs.

Referenced by GSkyDirs(), and operator=().

void GSkyDirs::extend ( const GSkyDirs dirs)

Append sky directions container.

Parameters
[in]dirsSky directions container.

Append sky directions container to the container.

Definition at line 314 of file GSkyDirs.cpp.

References is_empty(), m_dirs, reserve(), and size().

void GSkyDirs::free_members ( void  )
protected

Delete class members.

Definition at line 413 of file GSkyDirs.cpp.

Referenced by clear(), operator=(), and ~GSkyDirs().

void GSkyDirs::init_members ( void  )
protected

Initialise class members.

Definition at line 385 of file GSkyDirs.cpp.

References m_dirs.

Referenced by clear(), GSkyDirs(), and operator=().

GSkyDir & GSkyDirs::insert ( const int &  index,
const GSkyDir dir 
)

Insert sky direction into container.

Parameters
[in]indexSky direction index (0,...,size()-1).
[in]dirSky direction.
Exceptions
GException::out_of_rangeSky direction index is out of range.

Inserts a sky direction dir into the container before the sky direction with the specified index.

Definition at line 254 of file GSkyDirs.cpp.

References G_INSERT, is_empty(), m_dirs, and size().

bool GSkyDirs::is_empty ( void  ) const
inlinevirtual

Signals if there are no sky directions in container.

Returns
True if container is empty, false otherwise.

Signals if the sky directions container does not contain any sky direction.

Implements GContainer.

Definition at line 171 of file GSkyDirs.hpp.

References m_dirs.

Referenced by extend(), and insert().

GSkyDirs & GSkyDirs::operator= ( const GSkyDirs dirs)

Assignment operator.

Parameters
[in]dirsSky direction container.
Returns
Sky direction container.

Definition at line 143 of file GSkyDirs.cpp.

References copy_members(), free_members(), and init_members().

GSkyDir & GSkyDirs::operator[] ( const int &  index)
inline

Return reference to sky direction.

Parameters
[in]indexSky direction index [0,...,size()-1].

Returns a reference to the sky direction with the specified index.

Definition at line 109 of file GSkyDirs.hpp.

References m_dirs.

const GSkyDir & GSkyDirs::operator[] ( const int &  index) const
inline

Return reference to sky direction (const version)

Parameters
[in]indexSky direction index [0,...,size()-1].

Returns a const reference to the sky direction with the specified index.

Definition at line 124 of file GSkyDirs.hpp.

References m_dirs.

std::string GSkyDirs::print ( const GChatter chatter = NORMAL) const
virtual

Print sky directions container information.

Parameters
[in]chatterChattiness.
Returns
String containing sky directions container information.

Implements GBase.

Definition at line 345 of file GSkyDirs.cpp.

References EXPLICIT, m_dirs, gammalib::parformat(), SILENT, size(), and gammalib::str().

void GSkyDirs::remove ( const int &  index)
virtual

Remove sky direction from container.

Parameters
[in]indexSky direction index (0,...,size()-1).
Exceptions
GException::out_of_rangeSky direction index is out of range.

Remove sky direction of specified index from container.

Implements GContainer.

Definition at line 290 of file GSkyDirs.cpp.

References G_REMOVE, m_dirs, and size().

void GSkyDirs::reserve ( const int &  num)
inlinevirtual

Reserves space for sky directions in container.

Parameters
[in]numNumber of sky directions.

Reserves space for num sky directions in the container.

Implements GContainer.

Definition at line 185 of file GSkyDirs.hpp.

References m_dirs.

Referenced by extend().

int GSkyDirs::size ( void  ) const
inlinevirtual

Return number of sky directions in container.

Returns
Number of sky directions in container.

Returns the number of sky directions in the sky directions container.

Implements GContainer.

Definition at line 156 of file GSkyDirs.hpp.

References m_dirs.

Referenced by append(), at(), extend(), insert(), print(), and remove().

Member Data Documentation

std::vector<GSkyDir> GSkyDirs::m_dirs
protected

List of sky directions.

Definition at line 85 of file GSkyDirs.hpp.

Referenced by append(), at(), copy_members(), extend(), init_members(), insert(), is_empty(), operator[](), print(), remove(), reserve(), and size().


The documentation for this class was generated from the following files: