GammaLib
2.1.0.dev
|
Time container class. More...
#include <GTimes.hpp>
Public Member Functions | |
GTimes (void) | |
Void constructor. More... | |
GTimes (const GTimes ×) | |
Copy constructor. More... | |
virtual | ~GTimes (void) |
Destructor. More... | |
GTimes & | operator= (const GTimes ×) |
Assignment operator. More... | |
GTime & | operator[] (const int &index) |
Return reference to time. More... | |
const GTime & | operator[] (const int &index) const |
Return reference to time (const version) More... | |
void | clear (void) |
Clear container. More... | |
GTimes * | clone (void) const |
Clone object. More... | |
std::string | classname (void) const |
Return class name. More... | |
int | size (void) const |
Return number of times. More... | |
bool | is_empty (void) const |
Signal if there are no times. More... | |
void | append (const GTime &time) |
Append time to container. More... | |
void | insert (const int &index, const GTime &time) |
Insert time into container. More... | |
void | remove (const int &index) |
Remove time from container. More... | |
void | reserve (const int &num) |
Reserve memory for times in container. More... | |
void | extend (const GTimes ×) |
Append time container. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print time 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 GTimes ×) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::vector< GTime > | m_times |
List of times. More... | |
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(), GCOMHkd::print(), 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(), 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(), SILENT, size(), and gammalib::str().
|
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(), 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(), GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialAcceptance::mc(), GCTAModelBackground::mc(), GModelSky::mc(), 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[](), print(), remove(), reserve(), and size().