GammaLib
2.0.0
|
Sky directions container class. More...
#include <GSkyDirs.hpp>
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... | |
GSkyDirs & | operator= (const GSkyDirs &dirs) |
Assignment operator. More... | |
GSkyDir & | operator[] (const int &index) |
Return reference to sky direction. More... | |
const GSkyDir & | operator[] (const int &index) const |
Return reference to sky direction (const version) More... | |
void | clear (void) |
Clear sky directions container. More... | |
GSkyDirs * | clone (void) const |
Clone sky directions container. More... | |
std::string | classname (void) const |
Return class name. More... | |
GSkyDir & | at (const int &index) |
Return reference to sky direction. More... | |
const GSkyDir & | at (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... | |
GSkyDir & | append (const GSkyDir &dir) |
Append sky direction to container. More... | |
GSkyDir & | insert (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< GSkyDir > | m_dirs |
List of sky directions. More... | |
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.
GSkyDirs::GSkyDirs | ( | void | ) |
Void constructor.
Constructs empty sky directions container.
Definition at line 67 of file GSkyDirs.cpp.
References init_members().
Referenced by clone().
|
explicit |
Single sky direction constructor.
[in] | dir | Sky 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.
[in] | dirs | Sky 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().
|
virtual |
Append sky direction to container.
[in] | dir | 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().
|
inline |
Return reference to sky direction.
[in] | index | Sky direction index [0,...,size()-1]. |
GException::out_of_range | Sky 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)
[in] | index | Sky direction index [0,...,size()-1]. |
GException::out_of_range | Sky 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.
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 95 of file GSkyDirs.hpp.
|
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().
|
virtual |
Clone 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().
|
protected |
Copy class members.
[in] | dirs | Sky 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.
[in] | dirs | Sky 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().
|
protected |
Delete class members.
Definition at line 413 of file GSkyDirs.cpp.
Referenced by clear(), operator=(), and ~GSkyDirs().
|
protected |
Initialise class members.
Definition at line 385 of file GSkyDirs.cpp.
References m_dirs.
Referenced by clear(), GSkyDirs(), and operator=().
Insert sky direction into container.
[in] | index | Sky direction index (0,...,size()-1). |
[in] | dir | Sky direction. |
GException::out_of_range | Sky 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().
|
inlinevirtual |
Signals if there are no sky directions in container.
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.
Assignment operator.
[in] | dirs | Sky direction container. |
Definition at line 143 of file GSkyDirs.cpp.
References copy_members(), free_members(), and init_members().
|
inline |
Return reference to sky direction.
[in] | index | Sky 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.
|
inline |
Return reference to sky direction (const version)
[in] | index | Sky 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.
Print sky directions container information.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 345 of file GSkyDirs.cpp.
References EXPLICIT, m_dirs, gammalib::parformat(), SILENT, size(), and gammalib::str().
|
virtual |
Remove sky direction from container.
[in] | index | Sky direction index (0,...,size()-1). |
GException::out_of_range | Sky direction index is out of range. |
Remove sky direction of specified index
from container.
Implements GContainer.
Definition at line 290 of file GSkyDirs.cpp.
|
inlinevirtual |
Reserves space for sky directions in container.
[in] | num | Number 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().
|
inlinevirtual |
Return 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().
|
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().