FieldMetadata Class 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, V3f > | VecFloatMetadata
typedef std::map< std::string, V3i > | VecIntMetadata

## Public Member Functions

void | operator= (const FieldMetadata &other)
Constructors & destructor
| FieldMetadata (MetadataCallback *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.
MetadataCallback * | 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.

## Detailed Description

Definition at line 84 of file FieldMetadata.h.

## Member Typedef Documentation

## StrMetadata

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

Definition at line 90 of file FieldMetadata.h.

## IntMetadata

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

Definition at line 91 of file FieldMetadata.h.

## FloatMetadata

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

Definition at line 92 of file FieldMetadata.h.

## VecIntMetadata

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

Definition at line 93 of file FieldMetadata.h.

## VecFloatMetadata

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

Definition at line 94 of file FieldMetadata.h.

## Constructor & Destructor Documentation

## FieldMetadata() [1/2]

FieldMetadata::FieldMetadata | ( | MetadataCallback * | owner | ) |

inline

Definition at line 101 of file FieldMetadata.h.

: m_owner(owner)
{ }
FieldMetadata::m_owner
MetadataCallback * m_owner
Pointer to owner. It is assumed that this has a lifetime at least as long as the Metadata instance.
Definition FieldMetadata.h:204

References m_owner.

Referenced by FieldMetadata(), and operator=().

## ~FieldMetadata()

virtual FieldMetadata::~FieldMetadata | ( |  | ) |

inline virtual

Definition at line 105 of file FieldMetadata.h.

{}

## FieldMetadata() [2/2]

FieldMetadata::FieldMetadata | ( | const FieldMetadata & |  | ) |

private

References FieldMetadata().

## Member Function Documentation

## operator=()

void FieldMetadata::operator= | ( | const FieldMetadata & | other | ) |

inline

Definition at line 111 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;
}
FieldMetadata::m_intMetadata
IntMetadata m_intMetadata
Int metadata.
Definition FieldMetadata.h:198
FieldMetadata::m_strMetadata
StrMetadata m_strMetadata
String metadata.
Definition FieldMetadata.h:200
FieldMetadata::m_vecIntMetadata
VecIntMetadata m_vecIntMetadata
V3i metadata.
Definition FieldMetadata.h:196
FieldMetadata::m_vecFloatMetadata
VecFloatMetadata m_vecFloatMetadata
V3f metadata.
Definition FieldMetadata.h:192
FieldMetadata::m_floatMetadata
FloatMetadata m_floatMetadata
Float metadata.
Definition FieldMetadata.h:194

References FieldMetadata(), m_floatMetadata, m_intMetadata, m_strMetadata, m_vecFloatMetadata, and m_vecIntMetadata.

## vecFloatMetadata() [1/2]

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 113 of file FieldMetadata.cpp.

{
V3f retVal = defaultVal;
VecFloatMetadata::const_iterator i = m_vecFloatMetadata.find(name);
if (i != m_vecFloatMetadata.end()) {
retVal = i->second;
}
return retVal;
}
V3f
Imath::V3f V3f
Definition SpiMathLib.h:73

References m_vecFloatMetadata.

Referenced by Field3DOutputFile::writeMetadata(), and Field3DOutputFileHDF5::writeMetadata().

## floatMetadata() [1/2]

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 128 of file FieldMetadata.cpp.

{
float retVal = defaultVal;
FloatMetadata::const_iterator i = m_floatMetadata.find(name);
if (i != m_floatMetadata.end()) {
retVal = i->second;
}
return retVal;
}

References m_floatMetadata.

Referenced by Field3DOutputFile::writeMetadata(), and Field3DOutputFileHDF5::writeMetadata().

## vecIntMetadata() [1/2]

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 143 of file FieldMetadata.cpp.

{
V3i retVal = defaultVal;
VecIntMetadata::const_iterator i = m_vecIntMetadata.find(name);
if (i != m_vecIntMetadata.end()) {
retVal = i->second;
}
return retVal;
}
V3i
Imath::V3i V3i
Definition SpiMathLib.h:71

References m_vecIntMetadata.

Referenced by detail::adjustedMIPFieldMapping(), Field3DOutputFile::writeMetadata(), and Field3DOutputFileHDF5::writeMetadata().

## intMetadata() [1/2]

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 158 of file FieldMetadata.cpp.

{
int retVal = defaultVal;
IntMetadata::const_iterator i = m_intMetadata.find(name);
if (i != m_intMetadata.end()) {
retVal = i->second;
}
return retVal;
}

References m_intMetadata.

Referenced by Field3DOutputFile::writeMetadata(), and Field3DOutputFileHDF5::writeMetadata().

## strMetadata() [1/2]

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 173 of file FieldMetadata.cpp.

{
std::string retVal = defaultVal;
StrMetadata::const_iterator i = m_strMetadata.find(name);
if (i != m_strMetadata.end()) {
retVal = i->second;
}
return retVal;
}

References m_strMetadata.

Referenced by Field3DOutputFile::writeMetadata(), and Field3DOutputFileHDF5::writeMetadata().

## vecFloatMetadata() [2/2]

const VecFloatMetadata & FieldMetadata::vecFloatMetadata | ( |  | ) | const

inline

Read only access to the m_vecFloatMetadata dictionary.

Definition at line 147 of file FieldMetadata.h.

{ return m_vecFloatMetadata; }

References m_vecFloatMetadata.

## floatMetadata() [2/2]

const FloatMetadata & FieldMetadata::floatMetadata | ( |  | ) | const

inline

Read only access to the m_floatMetadata dictionary.

Definition at line 151 of file FieldMetadata.h.

{ return m_floatMetadata; }

References m_floatMetadata.

## vecIntMetadata() [2/2]

const VecIntMetadata & FieldMetadata::vecIntMetadata | ( |  | ) | const

inline

Read only access to the m_vecIntMetadata dictionary.

Definition at line 155 of file FieldMetadata.h.

{ return m_vecIntMetadata; }

References m_vecIntMetadata.

## intMetadata() [2/2]

const IntMetadata & FieldMetadata::intMetadata | ( |  | ) | const

inline

Read only access to the m_intMetadata dictionary.

Definition at line 159 of file FieldMetadata.h.

{ return m_intMetadata; }

References m_intMetadata.

## strMetadata() [2/2]

const StrMetadata & FieldMetadata::strMetadata | ( |  | ) | const

inline

Read only access to the m_strMetadata dictionary.

Definition at line 163 of file FieldMetadata.h.

{ return m_strMetadata; }

References m_strMetadata.

## setVecFloatMetadata()

FIELD3D_NAMESPACE_OPEN void FieldMetadata::setVecFloatMetadata | ( | const std::string & | name,
|  | const V3f & | val )

Set the a V3f value for the given metadata name.

Definition at line 58 of file FieldMetadata.cpp.

{
m_vecFloatMetadata[name] = val;
if (m_owner) {
m_owner->metadataHasChanged(name);
}
}

References m_owner, and m_vecFloatMetadata.

Referenced by Field3DInputFileHDF5::readMetadata().

## setFloatMetadata()

void FieldMetadata::setFloatMetadata | ( | const std::string & | name,
|  | const float | val )

Set the a float value for the given metadata name.

Definition at line 69 of file FieldMetadata.cpp.

{
m_floatMetadata[name] = val;
if (m_owner) {
m_owner->metadataHasChanged(name);
}
}

References m_floatMetadata, and m_owner.

Referenced by Field3DInputFileHDF5::readMetadata().

## setVecIntMetadata()

void FieldMetadata::setVecIntMetadata | ( | const std::string & | name,
|  | const V3i & | val )

Set the a V3i value for the given metadata name.

Definition at line 80 of file FieldMetadata.cpp.

{
m_vecIntMetadata[name] = val;
if (m_owner) {
m_owner->metadataHasChanged(name);
}
}

References m_owner, and m_vecIntMetadata.

Referenced by Field3DInputFileHDF5::readMetadata().

## setIntMetadata()

void FieldMetadata::setIntMetadata | ( | const std::string & | name,
|  | const int | val )

Set the a int value for the given metadata name.

Definition at line 91 of file FieldMetadata.cpp.

{
m_intMetadata[name] = val;
if (m_owner) {
m_owner->metadataHasChanged(name);
}
}

References m_intMetadata, and m_owner.

Referenced by Field3DInputFileHDF5::readMetadata(), Field3DInputFile::readProxyLayer(), and Field3DInputFileHDF5::readProxyLayer().

## setStrMetadata()

void FieldMetadata::setStrMetadata | ( | const std::string & | name,
|  | const std::string & | val )

Set the a string value for the given metadata name.

Definition at line 102 of file FieldMetadata.cpp.

{
m_strMetadata[name] = val;
if (m_owner) {
m_owner->metadataHasChanged(name);
}
}

References m_owner, and m_strMetadata.

Referenced by Field3DInputFileHDF5::readMetadata().

## Member Data Documentation

## m_vecFloatMetadata

VecFloatMetadata FieldMetadata::m_vecFloatMetadata

private

V3f metadata.

Definition at line 192 of file FieldMetadata.h.

Referenced by operator=(), setVecFloatMetadata(), vecFloatMetadata(), and vecFloatMetadata().

## m_floatMetadata

FloatMetadata FieldMetadata::m_floatMetadata

private

Float metadata.

Definition at line 194 of file FieldMetadata.h.

Referenced by floatMetadata(), floatMetadata(), operator=(), and setFloatMetadata().

## m_vecIntMetadata

VecIntMetadata FieldMetadata::m_vecIntMetadata

private

V3i metadata.

Definition at line 196 of file FieldMetadata.h.

Referenced by operator=(), setVecIntMetadata(), vecIntMetadata(), and vecIntMetadata().

## m_intMetadata

IntMetadata FieldMetadata::m_intMetadata

private

Int metadata.

Definition at line 198 of file FieldMetadata.h.

Referenced by intMetadata(), intMetadata(), operator=(), and setIntMetadata().

## m_strMetadata

StrMetadata FieldMetadata::m_strMetadata

private

String metadata.

Definition at line 200 of file FieldMetadata.h.

Referenced by operator=(), setStrMetadata(), strMetadata(), and strMetadata().

## m_owner

MetadataCallback* 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 204 of file FieldMetadata.h.

Referenced by FieldMetadata(), setFloatMetadata(), setIntMetadata(), setStrMetadata(), setVecFloatMetadata(), and setVecIntMetadata().

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

- export/FieldMetadata.h
- src/FieldMetadata.cpp