GammaLib
2.1.0.dev
|
Interface class for container classes. More...
#include <GContainer.hpp>
Public Member Functions | |
virtual | ~GContainer (void) |
Destructor. More... | |
virtual int | size (void) const =0 |
Return number of objects in container. More... | |
virtual bool | is_empty (void) const =0 |
Checks if container is empty. More... | |
virtual void | remove (const int &index)=0 |
Remove object from container. More... | |
virtual void | reserve (const int &num)=0 |
Reserves space in the container. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GBase * | clone (void) const =0 |
Clones object. More... | |
virtual std::string | classname (void) const =0 |
Return class name. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const =0 |
Print content of object. More... | |
Interface class for container classes.
This class defines the interface for container classes. The usage of the interface class imposes on all container classes are coherent interface. The following methods are mandatory:
clear - Clear container (inherited from GBase) clone - Clones container (inherited from GBase) classname - Returns the class name (inherited from GBase) print - Print container content (inherited from GBase) size - Returns number of objects is container is_empty - Checks if container is empty remove - Removes an object from the container reserve - Reserves space in the container
Definition at line 52 of file GContainer.hpp.
|
inlinevirtual |
|
pure virtual |
Checks if container is empty.
Implemented in GXml, GModels, GObservations, GFits, GEbounds, GEnergies, GXmlNode, GNodeArray, GGti, GFitsHeader, GSkyRegions, GCOMDris, GApplicationPars, GCOMBvcs, GOptimizerPars, GTestSuites, GCOMHkds, GCOMOads, GSkyDirs, GModelAssociations, GModelSpectralTablePars, GCOMHkd, GPhotons, GTimes, and GPhases.
|
pure virtual |
Remove object from container.
[in] | index | Index. |
Removes the object with the specified index
from the container.
Implemented in GXml, GModels, GObservations, GFits, GEbounds, GXmlNode, GEnergies, GGti, GNodeArray, GOptimizerPars, GFitsHeader, GApplicationPars, GSkyRegions, GCOMDris, GCOMHkds, GTestSuites, GCOMBvcs, GModelSpectralTablePars, GCOMOads, GModelAssociations, GSkyDirs, GCOMHkd, GPhotons, GTimes, and GPhases.
|
pure virtual |
Reserves space in the container.
[in] | num | Number of objects. |
Reserves space for num
objects in the container.
Implemented in GXml, GModels, GObservations, GFits, GEbounds, GXmlNode, GEnergies, GGti, GNodeArray, GOptimizerPars, GFitsHeader, GApplicationPars, GSkyRegions, GCOMDris, GCOMHkds, GTestSuites, GCOMBvcs, GModelSpectralTablePars, GModelAssociations, GCOMOads, GSkyDirs, GCOMHkd, GPhotons, GTimes, and GPhases.
|
pure virtual |
Return number of objects in container.
Implemented in GXml, GModels, GObservations, GFits, GEbounds, GEnergies, GXmlNode, GNodeArray, GGti, GFitsHeader, GSkyRegions, GCOMDris, GApplicationPars, GCOMBvcs, GOptimizerPars, GTestSuites, GCOMHkds, GCOMOads, GSkyDirs, GModelAssociations, GModelSpectralTablePars, GCOMHkd, GPhotons, GTimes, and GPhases.