|
My Project
|
A collection of attributes. More...
#include <mia/core/attributes.hh>
Constructors | |
| CAttributedData () | |
| CAttributedData (const CAttributedData &org) | |
| CAttributedData (PAttributeMap attr) | |
| CAttributedData & | operator= (const CAttributedData &org) |
| Assignemt operator. | |
| const PAttribute | get_attribute (const std::string &key) const |
| CAttributeMap::const_iterator | begin_attributes () const |
| CAttributeMap::const_iterator | end_attributes () const |
| void | set_attribute (const std::string &key, PAttribute attr) |
| void | set_attributes (CAttributeMap::const_iterator begin, CAttributeMap::const_iterator end) |
| void | set_attribute (const std::string &key, const std::string &value) |
| template<typename T> | |
| void | set_attribute (const std::string &key, const T &value) |
| void | set_attribute (const std::string &key, const char *value) |
| const std::string | get_attribute_as_string (const std::string &key) const |
| returns the requested attribute as string, returns an empty string if attribute doesn't exist | |
| template<typename T> | |
| const T | get_attribute_as (const std::string &key) const |
| template<typename T> | |
| const T | get_attribute_as (const std::string &key, T default_value) const |
| void | delete_attribute (const std::string &key) |
| bool | has_attribute (const std::string &key) const |
| void | print (std::ostream &os) const |
A collection of attributes.
This is the base class for all data that uses attributes. It provides all the needed functions to store and retrieve attributes.
Definition at line 259 of file attributes.hh.
| CAttributedData::CAttributedData | ( | ) |
Referenced by C2DImage::C2DImage(), C3DImage::C3DImage(), CAttributedData(), has_attribute(), operator=(), T2DVectorfield< C2DDVector >::T2DVectorfield(), T3DVectorfield< C3DDVector >::T3DVectorfield(), T3DVectorfield< C3DDVector >::T3DVectorfield(), and T3DVectorfield< C3DDVector >::T3DVectorfield().
| CAttributedData::CAttributedData | ( | const CAttributedData & | org | ) |
References CAttributedData().
| CAttributedData::CAttributedData | ( | PAttributeMap | attr | ) |
Constructor that initialises with a certain attribute map
| attr | the map to be initialised with |
| CAttributeMap::const_iterator CAttributedData::begin_attributes | ( | ) | const |
| void CAttributedData::delete_attribute | ( | const std::string & | key | ) |
Delete the attribute with a given key from the list
| key |
| CAttributeMap::const_iterator CAttributedData::end_attributes | ( | ) | const |
| const PAttribute CAttributedData::get_attribute | ( | const std::string & | key | ) | const |
| key |
Referenced by get_attribute_as(), get_attribute_as(), and T3DVectorfield< C3DDVector >::get_voxel_size().
| const T CAttributedData::get_attribute_as | ( | const std::string & | key | ) | const |
Look for a certain attribute and try to cast it to the output type. If the attribute is not found, a std::invalid_argument exception is thrown. If the cast fails then std::bad_cast exception will be thrown.
| key | the key of the attribute to look up. |
Definition at line 792 of file attributes.hh.
References create_exception(), and get_attribute().
| const T CAttributedData::get_attribute_as | ( | const std::string & | key, |
| T | default_value ) const |
Look for a certain attribute and try to cast it to the output type. If the attribute is not found, or the cast goes wrong use the default value In the latter case a warning is written out.
| key | the key of the attribute to look up. |
| default_value | the default value |
Definition at line 803 of file attributes.hh.
References cvwarn(), and get_attribute().
| const std::string CAttributedData::get_attribute_as_string | ( | const std::string & | key | ) | const |
returns the requested attribute as string, returns an empty string if attribute doesn't exist
| bool CAttributedData::has_attribute | ( | const std::string & | key | ) | const |
See if a certain attribute exists
| key |
References CAttributedData(), and EXPORT_CORE.
| CAttributedData & CAttributedData::operator= | ( | const CAttributedData & | org | ) |
Assignemt operator.
References CAttributedData().
|
inline |
Definition at line 380 of file attributes.hh.
Referenced by operator<<().
| void CAttributedData::set_attribute | ( | const std::string & | key, |
| const char * | value ) |
Set an attribute using one of the defined translators
| key | |
| value |
| void CAttributedData::set_attribute | ( | const std::string & | key, |
| const std::string & | value ) |
Set an attribute using one of the defined translators
| key | |
| value |
References set_attribute().
| void CAttributedData::set_attribute | ( | const std::string & | key, |
| const T & | value ) |
Set an attribute, generic version.
| T | type of the attribute value to be set |
| key | |
| value |
Definition at line 753 of file attributes.hh.
References add_attribute().
| void CAttributedData::set_attribute | ( | const std::string & | key, |
| PAttribute | attr ) |
Sets the attribute name to value attr. If attr is NULL, then the attribute is removed from the list (or not added)
| key | |
| attr |
Referenced by set_attribute(), and T3DVectorfield< C3DDVector >::set_voxel_size().
| void CAttributedData::set_attributes | ( | CAttributeMap::const_iterator | begin, |
| CAttributeMap::const_iterator | end ) |
Insersts or overwrites the attributes given in the input range
| begin | |
| end |