Field3D
FieldMetadata< CallBack_T > Class Template Reference

#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, V3fVecFloatMetadata
 
typedef std::map< std::string, V3iVecIntMetadata
 

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
const VecFloatMetadatavecFloatMetadata () const
 Read only access to the m_vecFloatMetadata dictionary. More...
 
const FloatMetadatafloatMetadata () const
 Read only access to the m_floatMetadata dictionary. More...
 
const VecIntMetadatavecIntMetadata () const
 Read only access to the m_vecIntMetadata dictionary. More...
 
const IntMetadataintMetadata () const
 Read only access to the m_intMetadata dictionary. More...
 
const StrMetadatastrMetadata () const
 Read only access to the m_strMetadata dictionary. More...
 
void setVecFloatMetadata (const std::string &name, const V3f &val)
 Set the a V3f value for the given metadata name. More...
 
void setFloatMetadata (const std::string &name, const float val)
 Set the a float value for the given metadata name. More...
 
void setVecIntMetadata (const std::string &name, const V3i &val)
 Set the a V3i value for the given metadata name. More...
 
void setIntMetadata (const std::string &name, const int val)
 Set the a int value for the given metadata name. More...
 
void setStrMetadata (const std::string &name, const std::string &val)
 Set the a string value for the given metadata name. More...
 

Private Member Functions

 FieldMetadata (const FieldMetadata &)
 

Private Attributes

FloatMetadata m_floatMetadata
 Float metadata. More...
 
IntMetadata m_intMetadata
 Int metadata. More...
 
CallBack_T * m_owner
 Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance. More...
 
StrMetadata m_strMetadata
 String metadata. More...
 
VecFloatMetadata m_vecFloatMetadata
 V3f metadata. More...
 
VecIntMetadata m_vecIntMetadata
 V3i metadata. More...
 

Detailed Description

template<class CallBack_T>
class FieldMetadata< CallBack_T >

Definition at line 69 of file FieldMetadata.h.

Member Typedef Documentation

template<class CallBack_T>
typedef std::map<std::string, std::string> FieldMetadata< CallBack_T >::StrMetadata

Definition at line 75 of file FieldMetadata.h.

template<class CallBack_T>
typedef std::map<std::string, int> FieldMetadata< CallBack_T >::IntMetadata

Definition at line 76 of file FieldMetadata.h.

template<class CallBack_T>
typedef std::map<std::string, float> FieldMetadata< CallBack_T >::FloatMetadata

Definition at line 77 of file FieldMetadata.h.

template<class CallBack_T>
typedef std::map<std::string, V3i> FieldMetadata< CallBack_T >::VecIntMetadata

Definition at line 78 of file FieldMetadata.h.

template<class CallBack_T>
typedef std::map<std::string, V3f> FieldMetadata< CallBack_T >::VecFloatMetadata

Definition at line 79 of file FieldMetadata.h.

Constructor & Destructor Documentation

template<class CallBack_T>
FieldMetadata< CallBack_T >::FieldMetadata ( CallBack_T *  owner)
inline

Definition at line 86 of file FieldMetadata.h.

Referenced by FieldMetadata< FieldBase >::strMetadata().

87  : m_owner(owner)
88  { }
CallBack_T * m_owner
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance...
template<class CallBack_T>
virtual FieldMetadata< CallBack_T >::~FieldMetadata ( )
inlinevirtual

Definition at line 90 of file FieldMetadata.h.

90 {}
template<class CallBack_T>
FieldMetadata< CallBack_T >::FieldMetadata ( const FieldMetadata< CallBack_T > &  )
private

Member Function Documentation

template<class CallBack_T>
void FieldMetadata< CallBack_T >::operator= ( const FieldMetadata< CallBack_T > &  other)
inline

Definition at line 96 of file FieldMetadata.h.

97  {
103  }
FloatMetadata m_floatMetadata
Float metadata.
VecFloatMetadata m_vecFloatMetadata
V3f metadata.
StrMetadata m_strMetadata
String metadata.
IntMetadata m_intMetadata
Int metadata.
VecIntMetadata m_vecIntMetadata
V3i metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_vecFloatMetadata.

Referenced by Field3DOutputFile::writeMetadata().

260 {
261  V3f retVal = defaultVal;
262 
263  VecFloatMetadata::const_iterator i = m_vecFloatMetadata.find(name);
264  if (i != m_vecFloatMetadata.end()) {
265  retVal = i->second;
266  }
267 
268  return retVal;
269 }
VecFloatMetadata m_vecFloatMetadata
V3f metadata.
Imath::V3f V3f
Definition: SpiMathLib.h:73
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_floatMetadata.

Referenced by ProceduralField< Data_T >::typedFloatMetadata(), and Field3DOutputFile::writeMetadata().

276 {
277  float retVal = defaultVal;
278 
279  FloatMetadata::const_iterator i = m_floatMetadata.find(name);
280  if (i != m_floatMetadata.end()) {
281  retVal = i->second;
282  }
283 
284  return retVal;
285 }
FloatMetadata m_floatMetadata
Float metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_vecIntMetadata.

Referenced by Field3DOutputFile::writeMetadata().

292 {
293  V3i retVal = defaultVal;
294 
295  VecIntMetadata::const_iterator i = m_vecIntMetadata.find(name);
296  if (i != m_vecIntMetadata.end()) {
297  retVal = i->second;
298  }
299 
300  return retVal;
301 }
Imath::V3i V3i
Definition: SpiMathLib.h:71
VecIntMetadata m_vecIntMetadata
V3i metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_intMetadata.

Referenced by ProceduralField< Data_T >::typedIntMetadata(), and Field3DOutputFile::writeMetadata().

308 {
309  int retVal = defaultVal;
310 
311  IntMetadata::const_iterator i = m_intMetadata.find(name);
312  if (i != m_intMetadata.end()) {
313  retVal = i->second;
314  }
315 
316  return retVal;
317 }
IntMetadata m_intMetadata
Int metadata.
template<class CallBack_T >
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.

References FIELD3D_NAMESPACE_HEADER_CLOSE, and FieldMetadata< CallBack_T >::m_strMetadata.

Referenced by Field3DOutputFile::writeMetadata().

324 {
325  std::string retVal = defaultVal;
326 
327  StrMetadata::const_iterator i = m_strMetadata.find(name);
328  if (i != m_strMetadata.end()) {
329  retVal = i->second;
330  }
331 
332  return retVal;
333 }
StrMetadata m_strMetadata
String metadata.
template<class CallBack_T>
const VecFloatMetadata& FieldMetadata< CallBack_T >::vecFloatMetadata ( ) const
inline

Read only access to the m_vecFloatMetadata dictionary.

Definition at line 132 of file FieldMetadata.h.

Referenced by FieldMetadata< FieldBase >::operator=().

133  { return m_vecFloatMetadata; }
VecFloatMetadata m_vecFloatMetadata
V3f metadata.
template<class CallBack_T>
const FloatMetadata& FieldMetadata< CallBack_T >::floatMetadata ( ) const
inline

Read only access to the m_floatMetadata dictionary.

Definition at line 136 of file FieldMetadata.h.

Referenced by FieldMetadata< FieldBase >::operator=().

137  { return m_floatMetadata; }
FloatMetadata m_floatMetadata
Float metadata.
template<class CallBack_T>
const VecIntMetadata& FieldMetadata< CallBack_T >::vecIntMetadata ( ) const
inline

Read only access to the m_vecIntMetadata dictionary.

Definition at line 140 of file FieldMetadata.h.

Referenced by FieldMetadata< FieldBase >::operator=().

141  { return m_vecIntMetadata; }
VecIntMetadata m_vecIntMetadata
V3i metadata.
template<class CallBack_T>
const IntMetadata& FieldMetadata< CallBack_T >::intMetadata ( ) const
inline

Read only access to the m_intMetadata dictionary.

Definition at line 144 of file FieldMetadata.h.

Referenced by FieldMetadata< FieldBase >::operator=().

145  { return m_intMetadata; }
IntMetadata m_intMetadata
Int metadata.
template<class CallBack_T>
const StrMetadata& FieldMetadata< CallBack_T >::strMetadata ( ) const
inline

Read only access to the m_strMetadata dictionary.

Definition at line 148 of file FieldMetadata.h.

Referenced by FieldMetadata< FieldBase >::operator=().

149  { return m_strMetadata; }
StrMetadata m_strMetadata
String metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_owner, and FieldMetadata< CallBack_T >::m_vecFloatMetadata.

Referenced by Field3DInputFile::readMetadata(), and FieldMetadata< FieldBase >::strMetadata().

200 {
201  m_vecFloatMetadata[name] = val;
202  if (m_owner) {
203  m_owner->metadataHasChanged(name);
204  }
205 }
CallBack_T * m_owner
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance...
VecFloatMetadata m_vecFloatMetadata
V3f metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_floatMetadata, and FieldMetadata< CallBack_T >::m_owner.

Referenced by Field3DInputFile::readMetadata(), and FieldMetadata< FieldBase >::strMetadata().

212 {
213  m_floatMetadata[name] = val;
214  if (m_owner) {
215  m_owner->metadataHasChanged(name);
216  }
217 }
CallBack_T * m_owner
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance...
FloatMetadata m_floatMetadata
Float metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_owner, and FieldMetadata< CallBack_T >::m_vecIntMetadata.

Referenced by Field3DInputFile::readMetadata(), and FieldMetadata< FieldBase >::strMetadata().

224 {
225  m_vecIntMetadata[name] = val;
226  if (m_owner) {
227  m_owner->metadataHasChanged(name);
228  }
229 }
CallBack_T * m_owner
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance...
VecIntMetadata m_vecIntMetadata
V3i metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_intMetadata, and FieldMetadata< CallBack_T >::m_owner.

Referenced by Field3DInputFile::readMetadata(), Field3DInputFile::readProxyLayer(), and FieldMetadata< FieldBase >::strMetadata().

236 {
237  m_intMetadata[name] = val;
238  if (m_owner) {
239  m_owner->metadataHasChanged(name);
240  }
241 }
CallBack_T * m_owner
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance...
IntMetadata m_intMetadata
Int metadata.
template<class CallBack_T >
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.

References FieldMetadata< CallBack_T >::m_owner, and FieldMetadata< CallBack_T >::m_strMetadata.

Referenced by Field3DInputFile::readMetadata(), and FieldMetadata< FieldBase >::strMetadata().

248 {
249  m_strMetadata[name] = val;
250  if (m_owner) {
251  m_owner->metadataHasChanged(name);
252  }
253 }
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.

Member Data Documentation

template<class CallBack_T>
StrMetadata FieldMetadata< CallBack_T >::m_strMetadata
private
template<class CallBack_T>
CallBack_T* FieldMetadata< CallBack_T >::m_owner
private

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