OpenMAMA C++ API
Wombat::MamaFieldCacheRecord Class Reference

The MamaFieldCacheRecord class is a collection of unordered MamaFieldCacheField elements. More...

#include <MamaFieldCacheRecord.h>

Public Member Functions

 MamaFieldCacheRecord ()
 Constructor. More...
 
virtual ~MamaFieldCacheRecord ()
 Destructor. More...
 
virtual void create ()
 Creates a MamaFieldCacheRecord. More...
 
virtual void clear ()
 Clear the MamaFieldCacheRecord. More...
 
virtual MamaFieldCacheFieldadd (mama_fid_t fid, mamaFieldType type, const char *name=NULL)
 Add and creates a MamaFieldCacheField to the record. More...
 
virtual MamaFieldCacheFieldadd (const MamaFieldDescriptor &descriptor)
 Add and creates a MamaFieldCacheField to the record. More...
 
virtual const MamaFieldCacheFieldoperator[] (mama_size_t index) const
 
virtual MamaFieldCacheFieldoperator[] (mama_size_t index)
 
virtual const MamaFieldCacheFieldfind (mama_fid_t fid, const char *name=NULL) const
 Find a MamaFieldCacheField in the record. More...
 
virtual MamaFieldCacheFieldfind (mama_fid_t fid, const char *name=NULL)
 Find a MamaFieldCacheField in the record. More...
 
virtual mama_size_t getSize () const
 Return the number of fields present in the record. More...
 
virtual mamaFieldCacheRecord getCValue ()
 
virtual const mamaFieldCacheRecord getCValue () const
 

Detailed Description

The MamaFieldCacheRecord class is a collection of unordered MamaFieldCacheField elements.

Constructor & Destructor Documentation

§ MamaFieldCacheRecord()

Wombat::MamaFieldCacheRecord::MamaFieldCacheRecord ( )

Constructor.

Use create to create the actual cache.

§ ~MamaFieldCacheRecord()

virtual Wombat::MamaFieldCacheRecord::~MamaFieldCacheRecord ( )
virtual

Destructor.

This is called automatically when an object is destroyed. This method will clean all the memory allocated.

Member Function Documentation

§ create()

virtual void Wombat::MamaFieldCacheRecord::create ( )
virtual

§ clear()

virtual void Wombat::MamaFieldCacheRecord::clear ( )
virtual

Clear the MamaFieldCacheRecord.

No fields will be present in the record after this operation. The record is ready to be used, as long as create has been called once.

§ add() [1/2]

virtual MamaFieldCacheField& Wombat::MamaFieldCacheRecord::add ( mama_fid_t  fid,
mamaFieldType  type,
const char *  name = NULL 
)
virtual

Add and creates a MamaFieldCacheField to the record.

The new field is then returned.

Parameters
fidField id of the field to create.
typeField type of the field to create.
nameName of the field to create.
Returns
The new field created.

§ add() [2/2]

virtual MamaFieldCacheField& Wombat::MamaFieldCacheRecord::add ( const MamaFieldDescriptor descriptor)
virtual

Add and creates a MamaFieldCacheField to the record.

The new field is then returned.

Parameters
descriptorDescriptor of the field to create.
Returns
The new field created.

§ operator[]() [1/2]

virtual const MamaFieldCacheField& Wombat::MamaFieldCacheRecord::operator[] ( mama_size_t  index) const
virtual

§ operator[]() [2/2]

virtual MamaFieldCacheField& Wombat::MamaFieldCacheRecord::operator[] ( mama_size_t  index)
virtual

§ find() [1/2]

virtual const MamaFieldCacheField& Wombat::MamaFieldCacheRecord::find ( mama_fid_t  fid,
const char *  name = NULL 
) const
virtual

Find a MamaFieldCacheField in the record.

Parameters
fidField id of the field to look up.
nameField name of the field to look up.
Returns
The field in the record.

§ find() [2/2]

virtual MamaFieldCacheField& Wombat::MamaFieldCacheRecord::find ( mama_fid_t  fid,
const char *  name = NULL 
)
virtual

Find a MamaFieldCacheField in the record.

Parameters
fidField id of the field to look up.
nameField name of the field to look up.
Returns
The field in the record.

§ getSize()

virtual mama_size_t Wombat::MamaFieldCacheRecord::getSize ( ) const
virtual

Return the number of fields present in the record.

Returns
Size of the record.

§ getCValue() [1/2]

virtual mamaFieldCacheRecord Wombat::MamaFieldCacheRecord::getCValue ( )
virtual

§ getCValue() [2/2]

virtual const mamaFieldCacheRecord Wombat::MamaFieldCacheRecord::getCValue ( ) const
virtual