|
GammaLib 2.2.0.dev
|
Time container class. More...
#include <GTimes.hpp>
Public Member Functions | |
| GTimes (void) | |
| Void constructor. | |
| GTimes (const GTimes ×) | |
| Copy constructor. | |
| virtual | ~GTimes (void) |
| Destructor. | |
| GTimes & | operator= (const GTimes ×) |
| Assignment operator. | |
| GTime & | operator[] (const int &index) |
| Return reference to time. | |
| const GTime & | operator[] (const int &index) const |
| Return reference to time (const version) | |
| void | clear (void) |
| Clear container. | |
| GTimes * | clone (void) const |
| Clone object. | |
| std::string | classname (void) const |
| Return class name. | |
| int | size (void) const |
| Return number of times. | |
| bool | is_empty (void) const |
| Signal if there are no times. | |
| void | append (const GTime &time) |
| Append time to container. | |
| void | insert (const int &index, const GTime &time) |
| Insert time into container. | |
| void | remove (const int &index) |
| Remove time from container. | |
| void | reserve (const int &num) |
| Reserve memory for times in container. | |
| void | extend (const GTimes ×) |
| Append time container. | |
| std::string | print (const GChatter &chatter=NORMAL) const |
| Print time container information. | |
Public Member Functions inherited from GContainer | |
| virtual | ~GContainer (void) |
| Destructor. | |
Public Member Functions inherited from GBase | |
| virtual | ~GBase (void) |
| Destructor. | |
Protected Member Functions | |
| void | init_members (void) |
| Initialise class members. | |
| void | copy_members (const GTimes ×) |
| Copy class members. | |
| void | free_members (void) |
| Delete class members. | |
Protected Attributes | |
| std::vector< GTime > | m_times |
| List of times. | |
Time container class.
This class is a container for times. Times are implemented by the GTime class which stores time in a system independent way.
Definition at line 45 of file GTimes.hpp.
| GTimes::GTimes | ( | void | ) |
Void constructor.
Definition at line 56 of file GTimes.cpp.
References init_members().
Referenced by clone().
| GTimes::GTimes | ( | const GTimes & | times | ) |
Copy constructor.
| times | Photon container. |
Definition at line 71 of file GTimes.cpp.
References copy_members(), and init_members().
|
virtual |
| void GTimes::append | ( | const GTime & | time | ) |
Append time to container.
| [in] | time | Time. |
This method appends a time to the container by copying it.
Definition at line 216 of file GTimes.cpp.
References m_times.
Referenced by GCOMHkd::append(), GCOMHkd::extend(), GModelTemporalConst::mc(), GModelTemporalLightCurve::mc(), GModelTemporalPhaseCurve::mc(), GSPIEventCube::read_gti(), gammalib::spi_annealing_start_times(), and gammalib::spi_gedfail_times().
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 88 of file GTimes.hpp.
|
virtual |
Clear container.
Implements GBase.
Definition at line 185 of file GTimes.cpp.
References free_members(), and init_members().
Referenced by GCOMHkd::init_members().
|
virtual |
Clone object.
Implements GBase.
Definition at line 203 of file GTimes.cpp.
References GTimes().
|
protected |
Copy class members.
| [in] | times | Time container. |
Definition at line 400 of file GTimes.cpp.
References m_times.
Referenced by GTimes(), and operator=().
| void GTimes::extend | ( | const GTimes & | times | ) |
Append time container.
| [in] | times | Time container. |
Append time container to the container.
Definition at line 299 of file GTimes.cpp.
References is_empty(), m_times, reserve(), and size().
|
protected |
Delete class members.
Definition at line 413 of file GTimes.cpp.
Referenced by clear(), operator=(), and ~GTimes().
|
protected |
Initialise class members.
Definition at line 385 of file GTimes.cpp.
References m_times.
Referenced by clear(), GTimes(), GTimes(), and operator=().
| void GTimes::insert | ( | const int & | index, |
| const GTime & | time ) |
Insert time into container.
| [in] | index | Time index [0,...,size()[. |
| [in] | time | Time. |
| GException::out_of_range | Time index is out of range. |
Inserts a time into the container before the time with the specified index.
Definition at line 238 of file GTimes.cpp.
References G_INSERT, is_empty(), m_times, and size().
Referenced by GCOMHkd::extend().
|
inlinevirtual |
Signal if there are no times.
Implements GContainer.
Definition at line 112 of file GTimes.hpp.
References m_times.
Referenced by extend(), insert(), and GCOMHkd::is_empty().
Assignment operator.
| [in] | times | Time container. |
Definition at line 109 of file GTimes.cpp.
References copy_members(), free_members(), and init_members().
| GTime & GTimes::operator[] | ( | const int & | index | ) |
Return reference to time.
| [in] | index | Time index [0,...,size()[. |
| GException::out_of_range | Time index is out of range. |
Definition at line 138 of file GTimes.cpp.
References G_OP_ACCESS, m_times, and size().
| const GTime & GTimes::operator[] | ( | const int & | index | ) | const |
Return reference to time (const version)
| [in] | index | Time index [0,...,size()[. |
| GException::out_of_range | Time index is out of range. |
Definition at line 161 of file GTimes.cpp.
References G_OP_ACCESS, m_times, and size().
Print time container information.
| [in] | chatter | Chattiness. |
Implements GBase.
Definition at line 347 of file GTimes.cpp.
References EXPLICIT, m_times, gammalib::parformat(), print(), SILENT, size(), and gammalib::str().
Referenced by print().
|
virtual |
Remove time from container.
| [in] | index | Time index [0,...,size()[. |
| GException::out_of_range | Time index is out of range. |
Remove time of specified index from container.
Implements GContainer.
Definition at line 274 of file GTimes.cpp.
References G_REMOVE, m_times, and size().
Referenced by GCOMHkd::remove().
|
virtual |
Reserve memory for times in container.
| [in] | num | Number of times. |
This method reserves memory for num times in the container.
Implements GContainer.
Definition at line 331 of file GTimes.cpp.
References m_times.
Referenced by extend(), GSPIEventCube::read_gti(), and GCOMHkd::reserve().
|
inlinevirtual |
Return number of times.
Implements GContainer.
Definition at line 100 of file GTimes.hpp.
References m_times.
Referenced by GSPIModelDataSpace::add_gedanneal(), GSPIModelDataSpace::add_gedfail(), extend(), insert(), GCTAModelAeffBackground::mc(), GCTAModelBackground::mc(), GCTAModelIrfBackground::mc(), GCTAModelRadialAcceptance::mc(), GModelSky::mc(), operator[](), operator[](), print(), remove(), and GCOMHkd::size().
|
protected |
List of times.
Definition at line 78 of file GTimes.hpp.
Referenced by append(), copy_members(), extend(), init_members(), insert(), is_empty(), operator[](), operator[](), print(), remove(), reserve(), and size().