OpenMAMA C++ API
Wombat::MamaFieldCacheField Class Reference

The MamaFieldCacheField class is used to store the information on the type of a field and its value(s). More...

#include <MamaFieldCacheField.h>

Public Member Functions

 MamaFieldCacheField ()
 Constructor. More...
 
virtual ~MamaFieldCacheField ()
 Destructor. More...
 
 MamaFieldCacheField (const MamaFieldCacheField &rhs)
 Copy constructor. More...
 
MamaFieldCacheFieldoperator= (const MamaFieldCacheField &rhs)
 Copy rhs into the current object. More...
 
bool operator== (const MamaFieldCacheField &rhs) const
 Return if the current field is equal to the specified field. More...
 
bool operator!= (const MamaFieldCacheField &rhs) const
 Return if the current field is different from the specified field. More...
 
virtual void create (const MamaFieldDescriptor &descriptor)
 Create a MamaFieldCacheField. More...
 
virtual void create (mama_fid_t fid, mamaFieldType type, const char *name=NULL)
 Create a MamaFieldCacheField. More...
 
virtual void clear ()
 Clear the MamaFieldCacheField. More...
 
virtual mama_fid_t getFid () const
 Return the field id. More...
 
virtual mamaFieldType getType () const
 Return the field type. More...
 
const char * getName () const
 Return the name of the field. More...
 
void setDescriptor (const MamaFieldDescriptor *descriptor)
 Set the descriptor of the field. More...
 
const MamaFieldDescriptorgetDescriptor () const
 Return the descriptor of the field. More...
 
virtual bool isModified () const
 Return whether the field has been modified or not. More...
 
virtual void setPublish (bool value=true)
 Set the publish flag of the field. More...
 
virtual bool getPublish () const
 Return the always publish flag of the field. More...
 
virtual void setCheckModified (bool value=true)
 Set the checkModifed flag of a field. More...
 
virtual bool getCheckModified () const
 Return the checkModified flag of the field. More...
 
virtual bool isVector () const
 Return if the field is a vector (otherwise is a single-value field). More...
 
mamaFieldCacheField & getCValue ()
 
const mamaFieldCacheField & getCValue () const
 

Detailed Description

The MamaFieldCacheField class is used to store the information on the type of a field and its value(s).

This class does not provide methods to set and get the value (check the specific types of fields such as MamaFieldCacheFieldBool).

Constructor & Destructor Documentation

§ MamaFieldCacheField() [1/2]

Wombat::MamaFieldCacheField::MamaFieldCacheField ( )

Constructor.

Use create to create the actual field.

§ ~MamaFieldCacheField()

virtual Wombat::MamaFieldCacheField::~MamaFieldCacheField ( )
virtual

Destructor.

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

§ MamaFieldCacheField() [2/2]

Wombat::MamaFieldCacheField::MamaFieldCacheField ( const MamaFieldCacheField rhs)

Copy constructor.

Parameters

Member Function Documentation

§ operator=()

MamaFieldCacheField& Wombat::MamaFieldCacheField::operator= ( const MamaFieldCacheField rhs)

Copy rhs into the current object.

Parameters
rhsThe source MamaFielCacheField.
Returns
The MamaFieldCacheField itself.

§ operator==()

bool Wombat::MamaFieldCacheField::operator== ( const MamaFieldCacheField rhs) const

Return if the current field is equal to the specified field.

Parameters
rhsThe other field to check equality.
Returns
Whether the two fields are equal.

§ operator!=()

bool Wombat::MamaFieldCacheField::operator!= ( const MamaFieldCacheField rhs) const

Return if the current field is different from the specified field.

Parameters
rhsThe other field to check difference.
Returns
Whether the two fields are different.

§ create() [1/2]

virtual void Wombat::MamaFieldCacheField::create ( const MamaFieldDescriptor descriptor)
virtual

Create a MamaFieldCacheField.

Parameters
descriptorDescriptor of the field to create.

§ create() [2/2]

virtual void Wombat::MamaFieldCacheField::create ( mama_fid_t  fid,
mamaFieldType  type,
const char *  name = NULL 
)
virtual

Create a MamaFieldCacheField.

Parameters
fidField id of the field to create.
typeField type of the field to create.
nameName of the field to create.

§ clear()

virtual void Wombat::MamaFieldCacheField::clear ( )
virtual

Clear the MamaFieldCacheField.

The field is ready to be used, as long as create has been called once.

§ getFid()

virtual mama_fid_t Wombat::MamaFieldCacheField::getFid ( ) const
virtual

Return the field id.

If the field is not valid, then 0 is returned.

Returns
The field id of the field.

§ getType()

§ getName()

const char* Wombat::MamaFieldCacheField::getName ( ) const

Return the name of the field.

If the name is not set, then NULL is returned.

Returns

§ setDescriptor()

void Wombat::MamaFieldCacheField::setDescriptor ( const MamaFieldDescriptor descriptor)

Set the descriptor of the field.

Parameters
descriptorPointer to the descriptor of the field.

§ getDescriptor()

const MamaFieldDescriptor* Wombat::MamaFieldCacheField::getDescriptor ( ) const

Return the descriptor of the field.

If the descriptor is not set, NULL is returned.

Returns
Pointer to the descriptor of the field.

§ isModified()

virtual bool Wombat::MamaFieldCacheField::isModified ( ) const
virtual

Return whether the field has been modified or not.

Returns
Whether the field is modified.

§ setPublish()

virtual void Wombat::MamaFieldCacheField::setPublish ( bool  value = true)
virtual

Set the publish flag of the field.

If set to false, the field is never published.

Parameters
valueThe publish flag.

§ getPublish()

virtual bool Wombat::MamaFieldCacheField::getPublish ( ) const
virtual

Return the always publish flag of the field.

Returns
The publish flag.

§ setCheckModified()

virtual void Wombat::MamaFieldCacheField::setCheckModified ( bool  value = true)
virtual

Set the checkModifed flag of a field.

If set to true, the field will be checked for modification before publishing.

Parameters
valueThe checkModified flag.

§ getCheckModified()

virtual bool Wombat::MamaFieldCacheField::getCheckModified ( ) const
virtual

Return the checkModified flag of the field.

Returns
The check modified flag.

§ isVector()

virtual bool Wombat::MamaFieldCacheField::isVector ( ) const
virtual

Return if the field is a vector (otherwise is a single-value field).

Returns
If the field is a vector field.

§ getCValue() [1/2]

mamaFieldCacheField& Wombat::MamaFieldCacheField::getCValue ( )

§ getCValue() [2/2]

const mamaFieldCacheField& Wombat::MamaFieldCacheField::getCValue ( ) const