#include <disti_metadata.h>
|
typedef DistiAttributeBase * | Attr_t |
|
typedef std::list< Attr_t > | List_t |
| Typedef for a list of attribute pointers.
|
|
typedef std::multimap< long, Attr_t > | Map_t |
| Typedef for a map ot attribute pointers.
|
|
typedef List_t::const_iterator | const_iterator |
| Shorthand for List_t::const_iterator.
|
|
typedef List_t::iterator | iterator |
| Shorthand for List_t::iterator.
|
|
The Attribute Dictionary is a container for DistiAttributeBase derived objects
◆ Attr_t
Allows for easy access to the contained class type
◆ DistiAttribDict() [1/2]
◆ ~DistiAttribDict()
◆ DistiAttribDict() [2/2]
Move constructor
- Parameters
-
◆ Add()
Adds the specified Attribute to the list. The object passed in becomes the responsibility of this class, and should NOT be deleted by the caller. It will be deleted by this class as needed.
- Parameters
-
attr | The attribute to add. |
◆ Begin() [1/2]
- Returns
- A iterator to the beginning of the list.
◆ Begin() [2/2]
- Returns
- A const iterator to the beginning of the list.
◆ Clear()
Removes all elements in the list, deleting the data as it goes
◆ CopyCommonValues()
Copies the values for all items which have matching names between this object and dict. All other values are ignored.
- Parameters
-
dict | The dictionary to copy from. |
◆ Count() [1/2]
- Returns
- The current number of elements in the dictionary.
◆ Count() [2/2]
- Parameters
-
name | The name of the element(s) to count up. |
- Returns
- The number of elements with the same name in the dictionary.
◆ Delete()
Removes the attribute specified by name from the dictionary and deletes the data.
- Parameters
-
name | The name of the attribute to remove. |
- Note
- This does actually delete the attribute.
◆ End() [1/2]
- Returns
- A iterator to the end of the list.
◆ End() [2/2]
- Returns
- A const iterator to the end of the list.
◆ Get()
- Parameters
-
name | The name of the attribute to return. |
- Returns
- The DistiAttributeBase* for the specified name, if not found it returns NULL.
◆ IsEqual()
bool IsEqual |
( |
const AttributeName & |
name, |
|
|
const long |
val |
|
) |
| const |
- Parameters
-
name | The name of the attribute to compare. |
val | The value to compare the attribute value with. |
- Returns
- A comparison of val with ValueInt() of the attribute looked up by name, false if not found.
◆ operator=() [1/2]
Copies the values for all items which have matching names between this object and dict. All other values are ignored.
- Parameters
-
dict | The dictionary to copy from. |
- Returns
- The combined dictionary (this).
- Deprecated:
- Use CopyCommonValues() instead.
◆ operator=() [2/2]
Move Assignment
- Parameters
-
- Returns
- This object, post move.
◆ operator==()
Equality operator Compares length, names and values, order does not matter.
- Parameters
-
other | The other dictionary to compare. |
- Returns
- Whether or not the dictionaries are equivalent.
◆ Read()
bool Read |
( |
std::istream & |
instr | ) |
|
Reads multiple attributes from the stream expecting the form: "NAME: VALUE"
- Parameters
-
instr | The stream to read from. |
- Returns
- True if something was found and set..
◆ ReadAndCaptureMissing()
bool ReadAndCaptureMissing |
( |
std::istream & |
instr, |
|
|
std::stringstream * |
missingStream |
|
) |
| |
Reads multiple attributes from the stream expecting the form: "NAME: VALUE" missing stream is filled with attributes that were not in the dictionary
- Parameters
-
instr | The stream to read from. |
missingStream | The return stream to write attributes that were not found. |
- Returns
- True if something was found and set.
◆ ReadStrings()
void ReadStrings |
( |
std::istream & |
instr | ) |
|
Reads a stream, expecting each line to be of the form: NAME: SomeStringValue For each line a new DistiAttribute<std::string> is created, and the remaining line is placed as it's value. This is intended for special uses and is not considered the 'normal' mode of operation.
- Parameters
-
instr | The stream to read from. |
◆ ReadValue()
std::istream & ReadValue |
( |
const AttributeName & |
name, |
|
|
std::istream & |
instr |
|
) |
| |
Calls ReadValue() for the attribute specified by name.
- Parameters
-
name | The name of the attribute to read in. |
instr | The stream to read from. |
- Returns
- The stream that was read from, in its current state.
◆ Remove()
Removes the attribute specified by name.
- Parameters
-
name | The name of the attribute to remove. |
- Note
- This does NOT actually delete the attribute, just removes it from the dictionary.
◆ ScanToken()
static bool ScanToken |
( |
std::istream & |
instr, |
|
|
std::string & |
result |
|
) |
| |
|
static |
Static method used for parsing a stream. Used internally and exposed here so others can use it.
- Parameters
-
instr | The stream to read from. |
result | The returned string that was parsed. |
- Returns
- True if parse was successful.
◆ SpacingDec()
static void SpacingDec |
( |
| ) |
|
|
static |
Static, Decrements the current spacing
◆ SpacingInc()
static void SpacingInc |
( |
| ) |
|
|
static |
Static, Increments the current spacing
◆ SpacingString()
static std::string SpacingString |
( |
| ) |
|
|
static |
- Note
- static
- Returns
- A string containing the current spacing.
◆ SpacingZero()
static void SpacingZero |
( |
| ) |
|
|
static |
Static, Sets the spacing to zero
◆ ValueInt() [1/2]
- Parameters
-
name | The name of the attribute whose value is to be returned. |
- Returns
- The ValueInt() of the named attribute.
◆ ValueInt() [2/2]
Sets the ValueInt() of the named attribute.
- Parameters
-
name | The attribute name whose value is to be set. |
val | The int value to set. |
◆ ValueString() [1/2]
- Parameters
-
name | The name of the attribute whose value is to be returned. |
- Returns
- The std::string value of the attribute specified by name, "" if not found.
- Note
- Internally it uses ValueString() from the attribute
◆ ValueString() [2/2]
void ValueString |
( |
const AttributeName & |
name, |
|
|
const std::string & |
val |
|
) |
| |
Sets the attribute of named 'name' to the value of 'val'.
- Parameters
-
name | The attribute name whose value is to be set. |
val | The string value to set. |
- Note
- If name is not found, there is no indication or error given.
◆ Write()
void Write |
( |
std::ostream & |
outstr, |
|
|
bool |
changedDataOnly = false |
|
) |
| |
Writes all items in the dictionary to the stream in the form: "NAME: VALUE" If changedDataOnly is true, only items which return ValueChanged() == true will be written.
- Parameters
-
outstr | The stream to write to. |
changedDataOnly | Whether or not to only write items where ValueChanged() == true. |
◆ WriteValue()
std::ostream & WriteValue |
( |
const AttributeName & |
name, |
|
|
std::ostream & |
outstr |
|
) |
| |
Calls WriteValue() for the attribute specified by name.
- Parameters
-
name | The name of the attribute to write out. |
outstr | The stream to write to. |
- Returns
- The stream that was written to, in its current state.
◆ _currentFileVersionBuild
unsigned int _currentFileVersionBuild |
|
static |
◆ _currentFileVersionMajor
unsigned int _currentFileVersionMajor |
|
static |
Used as needed for version specific parsing Whenever a version is parsed, the results should be stored here. This does add order dependency.
Note: These are not set or used by the DistiAttribDict class they are here to be set and accessed by the derived Attributes. Since they are shared by all instances of DistiAttribDict, they are only valid while the dictionary is parsing a file.
◆ _currentFileVersionMinor
unsigned int _currentFileVersionMinor |
|
static |
◆ _currentFileVersionPrimary
double _currentFileVersionPrimary |
|
static |
- Deprecated:
- Do not use. Will be removed in a later version.
◆ _currentFileVersionSecondary
long _currentFileVersionSecondary |
|
static |
- Deprecated:
- Do not use. Will be removed in a later version.
◆ currentOutputSpacing
Static, data for formating output
The documentation for this class was generated from the following file: