ldas-tools-framecpp 3.0.4
 
Loading...
Searching...
No Matches
FrameCPP::Common::ContainerBase< Obj > Class Template Referenceabstract

The base class for all containers. More...

#include <ContainerBase.hh>

Public Member Functions

virtual ~ContainerBase ()
 Destructor.
 
virtual Obj operator[] (unsigned int index)=0
 Container indexing.
 
virtual const Obj operator[] (unsigned int index) const =0
 Container indexing.
 
virtual unsigned int size () const =0
 Get container size.
 
unsigned int getSize () const
 Get container size.
 

Detailed Description

template<class Obj>
class FrameCPP::Common::ContainerBase< Obj >

The base class for all containers.

Most of the LIGO Frame components are containers which contain other frame components. For example, the RawData object is a container for AdcData, SerData, log messages, and other information. In a frame file, these containers are implemented as linked-lists. However, in the FrameCPP library these are implemented by a container class, "Container". This class standardizes the interface and maximizes code re-use.

ContainerBase is the base class for these container objects. The container classes themselves are templates, so this class allows the user to perform queries on the containers which do not require knowledge of the template type (the template type specifies what Frame class is stored in the container).

The methods defined are (they are all pure virtual):

  • write - Enable the container to be written to an output object. This is used by the Frame Object classes when they are being written. It is not meant to be called by the user.
  • operator[] - Return a pointer to a contained object. The parameter to this method is a zero-offset index into the container. The object is returned as a pointer to Base (the base class for all frame classes) by index.
  • size - Returns the number of elements in the container.

The destructor is also declared virtual so that the container can be destructed with only a pointer to the ContainerBase parent.

Todo
Implement iterators which dereference to Base*'s. This will allow the todo: STL iterator model to be used with this class.

Member Function Documentation

◆ operator[]() [1/2]

template<class Obj>
virtual const Obj FrameCPP::Common::ContainerBase< Obj >::operator[] ( unsigned int index) const
pure virtual

Container indexing.

Exceptions
range_error

◆ operator[]() [2/2]

template<class Obj>
virtual Obj FrameCPP::Common::ContainerBase< Obj >::operator[] ( unsigned int index)
pure virtual

Container indexing.

Exceptions
range_error

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