Field3D
FieldMetadata Class Reference

#include <FieldMetadata.h>

List of all members.

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 VecFloatMetadatavecFloatMetadata () const
 Read only access to the m_vecFloatMetadata dictionary.
const FloatMetadatafloatMetadata () const
 Read only access to the m_floatMetadata dictionary.
const VecIntMetadatavecIntMetadata () const
 Read only access to the m_vecIntMetadata dictionary.
const IntMetadataintMetadata () const
 Read only access to the m_intMetadata dictionary.
const StrMetadatastrMetadata () 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.

Member Typedef Documentation

typedef std::map<std::string, std::string> FieldMetadata::StrMetadata

Definition at line 75 of file FieldMetadata.h.

typedef std::map<std::string, int> FieldMetadata::IntMetadata

Definition at line 76 of file FieldMetadata.h.

typedef std::map<std::string, float> FieldMetadata::FloatMetadata

Definition at line 77 of file FieldMetadata.h.

typedef std::map<std::string, V3i> FieldMetadata::VecIntMetadata

Definition at line 78 of file FieldMetadata.h.

typedef std::map<std::string, V3f> FieldMetadata::VecFloatMetadata

Definition at line 79 of file FieldMetadata.h.


Constructor & Destructor Documentation

FieldMetadata::FieldMetadata ( CallBack_T *  owner) [inline]

Definition at line 86 of file FieldMetadata.h.

    : m_owner(owner)
  { } 
virtual FieldMetadata::~FieldMetadata ( ) [inline, virtual]

Definition at line 90 of file FieldMetadata.h.

{} 
FieldMetadata::FieldMetadata ( const FieldMetadata ) [private]

Member Function Documentation

void FieldMetadata::operator= ( const FieldMetadata other) [inline]
V3f FieldMetadata::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::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::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::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::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::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::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::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::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::strMetadata ( ) const [inline]

Read only access to the m_strMetadata dictionary.

Definition at line 148 of file FieldMetadata.h.

  { return m_strMetadata; }
void FieldMetadata::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::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::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::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::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);
  }
}

Member Data Documentation

CallBack_T* FieldMetadata::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.


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