Field3D
|
#include <FieldMetadata.h>
Public Types | |
typedef std::map< std::string, float > | FloatMetadata |
typedef std::map< std::string, int > | IntMetadata |
typedef std::map< std::string, std::string > | StrMetadata |
typedef std::map< std::string, V3f > | VecFloatMetadata |
typedef std::map< std::string, V3i > | VecIntMetadata |
Public Member Functions | |
void | operator= (const FieldMetadata &other) |
Constructors & destructor | |
FieldMetadata (CallBack_T *owner) | |
virtual | ~FieldMetadata () |
Metadata | |
V3f | vecFloatMetadata (const std::string &name, const V3f &defaultVal) const |
Tries to retrieve a V3f metadata value. Returns the specified default value if no metadata was found. | |
float | floatMetadata (const std::string &name, const float defaultVal) const |
Tries to retrieve a float metadata value. Returns the specified default value if no metadata was found. | |
V3i | vecIntMetadata (const std::string &name, const V3i &defaultVal) const |
Tries to retrieve a V3i metadata value. Returns the specified default value if no metadata was found. | |
int | intMetadata (const std::string &name, const int defaultVal) const |
Tries to retrieve an int metadata value. Returns the specified default value if no metadata was found. | |
std::string | strMetadata (const std::string &name, const std::string &defaultVal) const |
Tries to retrieve a string metadata value. Returns the specified default value if no metadata was found. | |
const VecFloatMetadata & | vecFloatMetadata () const |
Read only access to the m_vecFloatMetadata dictionary. | |
const FloatMetadata & | floatMetadata () const |
Read only access to the m_floatMetadata dictionary. | |
const VecIntMetadata & | vecIntMetadata () const |
Read only access to the m_vecIntMetadata dictionary. | |
const IntMetadata & | intMetadata () const |
Read only access to the m_intMetadata dictionary. | |
const StrMetadata & | strMetadata () const |
Read only access to the m_strMetadata dictionary. | |
void | setVecFloatMetadata (const std::string &name, const V3f &val) |
Set the a V3f value for the given metadata name. | |
void | setFloatMetadata (const std::string &name, const float val) |
Set the a float value for the given metadata name. | |
void | setVecIntMetadata (const std::string &name, const V3i &val) |
Set the a V3i value for the given metadata name. | |
void | setIntMetadata (const std::string &name, const int val) |
Set the a int value for the given metadata name. | |
void | setStrMetadata (const std::string &name, const std::string &val) |
Set the a string value for the given metadata name. | |
Private Member Functions | |
FieldMetadata (const FieldMetadata &) | |
Private Attributes | |
FloatMetadata | m_floatMetadata |
Float metadata. | |
IntMetadata | m_intMetadata |
Int metadata. | |
CallBack_T * | m_owner |
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance. | |
StrMetadata | m_strMetadata |
String metadata. | |
VecFloatMetadata | m_vecFloatMetadata |
V3f metadata. | |
VecIntMetadata | m_vecIntMetadata |
V3i metadata. |
Definition at line 69 of file FieldMetadata.h.
typedef std::map<std::string, std::string> FieldMetadata< CallBack_T >::StrMetadata |
Definition at line 75 of file FieldMetadata.h.
typedef std::map<std::string, int> FieldMetadata< CallBack_T >::IntMetadata |
Definition at line 76 of file FieldMetadata.h.
typedef std::map<std::string, float> FieldMetadata< CallBack_T >::FloatMetadata |
Definition at line 77 of file FieldMetadata.h.
typedef std::map<std::string, V3i> FieldMetadata< CallBack_T >::VecIntMetadata |
Definition at line 78 of file FieldMetadata.h.
typedef std::map<std::string, V3f> FieldMetadata< CallBack_T >::VecFloatMetadata |
Definition at line 79 of file FieldMetadata.h.
FieldMetadata< CallBack_T >::FieldMetadata | ( | CallBack_T * | owner | ) | [inline] |
Definition at line 86 of file FieldMetadata.h.
: m_owner(owner) { }
virtual FieldMetadata< CallBack_T >::~FieldMetadata | ( | ) | [inline, virtual] |
Definition at line 90 of file FieldMetadata.h.
{}
FieldMetadata< CallBack_T >::FieldMetadata | ( | const FieldMetadata< CallBack_T > & | ) | [private] |
void FieldMetadata< CallBack_T >::operator= | ( | const FieldMetadata< CallBack_T > & | other | ) | [inline] |
Definition at line 96 of file FieldMetadata.h.
{ m_vecFloatMetadata = other.m_vecFloatMetadata; m_floatMetadata = other.m_floatMetadata; m_vecIntMetadata = other.m_vecIntMetadata; m_intMetadata = other.m_intMetadata; m_strMetadata = other.m_strMetadata; }
V3f FieldMetadata< CallBack_T >::vecFloatMetadata | ( | const std::string & | name, |
const V3f & | defaultVal | ||
) | const |
Tries to retrieve a V3f metadata value. Returns the specified default value if no metadata was found.
Definition at line 258 of file FieldMetadata.h.
Referenced by Field3DOutputFile::writeMetadata().
{ V3f retVal = defaultVal; VecFloatMetadata::const_iterator i = m_vecFloatMetadata.find(name); if (i != m_vecFloatMetadata.end()) { retVal = i->second; } return retVal; }
float FieldMetadata< CallBack_T >::floatMetadata | ( | const std::string & | name, |
const float | defaultVal | ||
) | const |
Tries to retrieve a float metadata value. Returns the specified default value if no metadata was found.
Definition at line 274 of file FieldMetadata.h.
Referenced by Field3DOutputFile::writeMetadata().
{ float retVal = defaultVal; FloatMetadata::const_iterator i = m_floatMetadata.find(name); if (i != m_floatMetadata.end()) { retVal = i->second; } return retVal; }
V3i FieldMetadata< CallBack_T >::vecIntMetadata | ( | const std::string & | name, |
const V3i & | defaultVal | ||
) | const |
Tries to retrieve a V3i metadata value. Returns the specified default value if no metadata was found.
Definition at line 290 of file FieldMetadata.h.
Referenced by Field3DOutputFile::writeMetadata().
{ V3i retVal = defaultVal; VecIntMetadata::const_iterator i = m_vecIntMetadata.find(name); if (i != m_vecIntMetadata.end()) { retVal = i->second; } return retVal; }
int FieldMetadata< CallBack_T >::intMetadata | ( | const std::string & | name, |
const int | defaultVal | ||
) | const |
Tries to retrieve an int metadata value. Returns the specified default value if no metadata was found.
Definition at line 306 of file FieldMetadata.h.
Referenced by Field3DOutputFile::writeMetadata().
{ int retVal = defaultVal; IntMetadata::const_iterator i = m_intMetadata.find(name); if (i != m_intMetadata.end()) { retVal = i->second; } return retVal; }
std::string FieldMetadata< CallBack_T >::strMetadata | ( | const std::string & | name, |
const std::string & | defaultVal | ||
) | const |
Tries to retrieve a string metadata value. Returns the specified default value if no metadata was found.
Definition at line 322 of file FieldMetadata.h.
Referenced by Field3DOutputFile::writeMetadata().
{ std::string retVal = defaultVal; StrMetadata::const_iterator i = m_strMetadata.find(name); if (i != m_strMetadata.end()) { retVal = i->second; } return retVal; }
const VecFloatMetadata& FieldMetadata< CallBack_T >::vecFloatMetadata | ( | ) | const [inline] |
Read only access to the m_vecFloatMetadata dictionary.
Definition at line 132 of file FieldMetadata.h.
{ return m_vecFloatMetadata; }
const FloatMetadata& FieldMetadata< CallBack_T >::floatMetadata | ( | ) | const [inline] |
Read only access to the m_floatMetadata dictionary.
Definition at line 136 of file FieldMetadata.h.
{ return m_floatMetadata; }
const VecIntMetadata& FieldMetadata< CallBack_T >::vecIntMetadata | ( | ) | const [inline] |
Read only access to the m_vecIntMetadata dictionary.
Definition at line 140 of file FieldMetadata.h.
{ return m_vecIntMetadata; }
const IntMetadata& FieldMetadata< CallBack_T >::intMetadata | ( | ) | const [inline] |
Read only access to the m_intMetadata dictionary.
Definition at line 144 of file FieldMetadata.h.
{ return m_intMetadata; }
const StrMetadata& FieldMetadata< CallBack_T >::strMetadata | ( | ) | const [inline] |
Read only access to the m_strMetadata dictionary.
Definition at line 148 of file FieldMetadata.h.
{ return m_strMetadata; }
void FieldMetadata< CallBack_T >::setVecFloatMetadata | ( | const std::string & | name, |
const V3f & | val | ||
) |
Set the a V3f value for the given metadata name.
Definition at line 198 of file FieldMetadata.h.
Referenced by Field3DInputFile::readMetadata().
{ m_vecFloatMetadata[name] = val; if (m_owner) { m_owner->metadataHasChanged(name); } }
void FieldMetadata< CallBack_T >::setFloatMetadata | ( | const std::string & | name, |
const float | val | ||
) |
Set the a float value for the given metadata name.
Definition at line 210 of file FieldMetadata.h.
Referenced by Field3DInputFile::readMetadata().
{ m_floatMetadata[name] = val; if (m_owner) { m_owner->metadataHasChanged(name); } }
void FieldMetadata< CallBack_T >::setVecIntMetadata | ( | const std::string & | name, |
const V3i & | val | ||
) |
Set the a V3i value for the given metadata name.
Definition at line 222 of file FieldMetadata.h.
Referenced by Field3DInputFile::readMetadata().
{ m_vecIntMetadata[name] = val; if (m_owner) { m_owner->metadataHasChanged(name); } }
void FieldMetadata< CallBack_T >::setIntMetadata | ( | const std::string & | name, |
const int | val | ||
) |
Set the a int value for the given metadata name.
Definition at line 234 of file FieldMetadata.h.
Referenced by Field3DInputFile::readMetadata().
{ m_intMetadata[name] = val; if (m_owner) { m_owner->metadataHasChanged(name); } }
void FieldMetadata< CallBack_T >::setStrMetadata | ( | const std::string & | name, |
const std::string & | val | ||
) |
Set the a string value for the given metadata name.
Definition at line 246 of file FieldMetadata.h.
Referenced by Field3DInputFile::readMetadata().
{ m_strMetadata[name] = val; if (m_owner) { m_owner->metadataHasChanged(name); } }
VecFloatMetadata FieldMetadata< CallBack_T >::m_vecFloatMetadata [private] |
V3f metadata.
Definition at line 177 of file FieldMetadata.h.
Referenced by FieldMetadata< FieldBase >::operator=(), and FieldMetadata< FieldBase >::vecFloatMetadata().
FloatMetadata FieldMetadata< CallBack_T >::m_floatMetadata [private] |
Float metadata.
Definition at line 179 of file FieldMetadata.h.
Referenced by FieldMetadata< FieldBase >::floatMetadata(), and FieldMetadata< FieldBase >::operator=().
VecIntMetadata FieldMetadata< CallBack_T >::m_vecIntMetadata [private] |
V3i metadata.
Definition at line 181 of file FieldMetadata.h.
Referenced by FieldMetadata< FieldBase >::operator=(), and FieldMetadata< FieldBase >::vecIntMetadata().
IntMetadata FieldMetadata< CallBack_T >::m_intMetadata [private] |
Int metadata.
Definition at line 183 of file FieldMetadata.h.
Referenced by FieldMetadata< FieldBase >::intMetadata(), and FieldMetadata< FieldBase >::operator=().
StrMetadata FieldMetadata< CallBack_T >::m_strMetadata [private] |
String metadata.
Definition at line 185 of file FieldMetadata.h.
Referenced by FieldMetadata< FieldBase >::operator=(), and FieldMetadata< FieldBase >::strMetadata().
CallBack_T* FieldMetadata< CallBack_T >::m_owner [private] |
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance.
Definition at line 189 of file FieldMetadata.h.