GammaLib  1.7.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 GCOMOads GEbounds GEnergies GFits GFitsHeader GGti GModels GNodeArray GObservations GOptimizerPars GPhases GPhotons 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, GXmlNode, GEbounds, GEnergies, GNodeArray, GGti, GFitsHeader, GSkyRegions, GApplicationPars, GOptimizerPars, GTestSuites, GCOMOads, 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, GXmlNode, GEbounds, GGti, GEnergies, GNodeArray, GOptimizerPars, GFitsHeader, GApplicationPars, GSkyRegions, GTestSuites, GCOMOads, 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, GXmlNode, GEbounds, GGti, GEnergies, GNodeArray, GOptimizerPars, GFitsHeader, GApplicationPars, GSkyRegions, GTestSuites, GCOMOads, GPhotons, GTimes, and GPhases.

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

Return number of objects in container.

Returns
Number of objects in container.

Implemented in GXml, GModels, GObservations, GFits, GXmlNode, GEbounds, GEnergies, GNodeArray, GGti, GFitsHeader, GSkyRegions, GApplicationPars, GOptimizerPars, GTestSuites, GCOMOads, GPhotons, GTimes, and GPhases.


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