ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
SG::PackedContainer< T, ALLOC > Class Template Reference

Container to hold aux data to be stored in a packed form. More...

#include <PackedContainer.h>

Inheritance diagram for SG::PackedContainer< T, ALLOC >:
Collaboration diagram for SG::PackedContainer< T, ALLOC >:

Public Types

typedef std::vector< T, ALLOC > vector_type
 We act like this type. More...
 

Public Member Functions

 PackedContainer ()
 Constructor. More...
 
virtual bool setOption (const AuxDataOption &option) override
 Set a packing option. More...
 
bool setOption (const std::string &name, int val)
 Set a packing option. More...
 
bool setOption (const std::string &name, float val)
 Set a packing option. More...
 
bool setOption (const std::string &name, double val)
 Set a packing option. More...
 
const PackedParametersparms () const
 Return the packing parameters for this container. More...
 
void setParms (const PackedParameters &parms)
 Set the packing parameters. More...
 

Public Attributes

elements
 STL member. More...
 

Private Attributes

PackedParameters m_parms
 The packing parameters. More...
 

Detailed Description

template<class T, class ALLOC = AuxAllocator_t<T>>
class SG::PackedContainer< T, ALLOC >

Container to hold aux data to be stored in a packed form.

This class acts as a std::vector<T> (in fact, it derives from that type). However, we set up a special ROOT streamer for this type so that when it is saved, it is written in a packed format. The details of the packing are given by the PackedParameters (which see) instance that we hold.

User code should generally not interact with this class directly.

PackedContainer may be used as a static auxiliary variable by using it instead of the corresponding vector class in the auxiliary store class. Packing parameters may then be set by calling setOption from the constructor for the aux store object.

For dynamic auxiliary variables, the stored vector is automatically converted to a PackedContainer when setOption is called for the variable.

Definition at line 48 of file PackedContainer.h.

Member Typedef Documentation

◆ vector_type

template<class T , class ALLOC = AuxAllocator_t<T>>
typedef std::vector<T, ALLOC> SG::PackedContainer< T, ALLOC >::vector_type

We act like this type.

Definition at line 53 of file PackedContainer.h.

Constructor & Destructor Documentation

◆ PackedContainer()

template<class T , class ALLOC = AuxAllocator_t<T>>
SG::PackedContainer< T, ALLOC >::PackedContainer ( )

Constructor.

The packing parameters will be initialized to defaults appropriate for type T. (See PackedParameters.)

Member Function Documentation

◆ parms()

template<class T , class ALLOC = AuxAllocator_t<T>>
const PackedParameters& SG::PackedContainer< T, ALLOC >::parms ( ) const

Return the packing parameters for this container.

◆ setOption() [1/4]

template<class T , class ALLOC = AuxAllocator_t<T>>
virtual bool SG::PackedContainer< T, ALLOC >::setOption ( const AuxDataOption option)
overridevirtual

Set a packing option.

Parameters
optionThe option to set.

Returns true on success, false otherwise.

See PackedParameters::setOptions for details.

Implements SG::IAuxSetOption.

◆ setOption() [2/4]

template<class T , class ALLOC = AuxAllocator_t<T>>
bool SG::PackedContainer< T, ALLOC >::setOption ( const std::string &  name,
double  val 
)

Set a packing option.

Parameters
nameThe option name.
valThe option value.

Returns true on success, false otherwise.

See PackedParameters::setOptions for details.

◆ setOption() [3/4]

template<class T , class ALLOC = AuxAllocator_t<T>>
bool SG::PackedContainer< T, ALLOC >::setOption ( const std::string &  name,
float  val 
)

Set a packing option.

Parameters
nameThe option name.
valThe option value.

Returns true on success, false otherwise.

See PackedParameters::setOptions for details.

◆ setOption() [4/4]

template<class T , class ALLOC = AuxAllocator_t<T>>
bool SG::PackedContainer< T, ALLOC >::setOption ( const std::string &  name,
int  val 
)

Set a packing option.

Parameters
nameThe option name.
valThe option value.

Returns true on success, false otherwise.

See PackedParameters::setOptions for details.

◆ setParms()

template<class T , class ALLOC = AuxAllocator_t<T>>
void SG::PackedContainer< T, ALLOC >::setParms ( const PackedParameters parms)

Set the packing parameters.

Parameters
parmsThe new packing parameters.

Member Data Documentation

◆ elements

T std::vector< T >::elements
inherited

STL member.

◆ m_parms

template<class T , class ALLOC = AuxAllocator_t<T>>
PackedParameters SG::PackedContainer< T, ALLOC >::m_parms
private

The packing parameters.

Definition at line 127 of file PackedContainer.h.


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