GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GContainer Class Referenceabstract

Interface class for container classes. More...

#include <GContainer.hpp>

Inheritance diagram for GContainer:
GBase GApplicationPars GCOMBvcs GCOMDris GCOMHkd GCOMHkds GCOMOads GEbounds GEnergies GFits GFitsHeader GGti GModelAssociations GModels GModelSpectralTablePars GNodeArray GObservations GOptimizerPars GPhases GPhotons GSkyDirs GSkyRegions GTestSuites GTimes GXml GXmlNode

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 GBaseclone (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

virtual GContainer::~GContainer ( void  )
inlinevirtual

Destructor.

Destroys class.

Definition at line 58 of file GContainer.hpp.

Member Function Documentation

virtual bool GContainer::is_empty ( void  ) const
pure virtual

Checks if container is empty.

Returns
True if no objects are in container, false otherwise.

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.

virtual void GContainer::remove ( const int &  index)
pure virtual

Remove object from container.

Parameters
[in]indexIndex.

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.

virtual void GContainer::reserve ( const int &  num)
pure virtual

Reserves space in the container.

Parameters
[in]numNumber 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.

virtual int GContainer::size ( void  ) const
pure virtual

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