Public Member Functions
CAttributedData Class Reference

A collection of attributes. More...

#include <mia/core/attributes.hh>

Inheritance diagram for CAttributedData:
C2DImage C3DImage T2DVectorfield< T > T2DVectorfield< C2DFVector > T3DVectorfield< T > T3DVectorfield< C3DFVector > Transformation< D, I > Transformation< C2DImage, C2DInterpolatorFactory > Transformation< C3DImage, C3DInterpolatorFactory >

Public Member Functions

CAttributeMap::const_iterator begin_attributes () const
 
void delete_attribute (const std::string &key)
 
CAttributeMap::const_iterator end_attributes () const
 
const PAttribute get_attribute (const std::string &key) const
 
template<typename T >
const T get_attribute_as (const std::string &key) const
 
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 More...
 
bool has_attribute (const std::string &key) const
 
CAttributedDataoperator= (const CAttributedData &org)
 Assignemt operator. More...
 
void set_attribute (const std::string &key, PAttribute attr)
 
void set_attribute (const std::string &key, const std::string &value)
 
void set_attributes (CAttributeMap::const_iterator begin, CAttributeMap::const_iterator end)
 
Constructors
 CAttributedData ()
 
 CAttributedData (const CAttributedData &org)
 
 CAttributedData (PAttributeMap attr)
 

Detailed Description

A collection of attributes.

This is the base class for all data that uses attributes. It provides all the needed functions to store and retrive attributes.

Definition at line 252 of file attributes.hh.

Constructor & Destructor Documentation

CAttributedData::CAttributedData ( )
CAttributedData::CAttributedData ( const CAttributedData org)
CAttributedData::CAttributedData ( PAttributeMap  attr)

Constructor that initialises with a certain attribute map

Parameters
attrthe map to be initialised with

Member Function Documentation

CAttributeMap::const_iterator CAttributedData::begin_attributes ( ) const
Returns
the begin iterator to the attributes
void CAttributedData::delete_attribute ( const std::string &  key)

Delete the attribute with a given key from the list

Parameters
key
CAttributeMap::const_iterator CAttributedData::end_attributes ( ) const
Returns
the end iterator to the attributes
const PAttribute CAttributedData::get_attribute ( const std::string &  key) const
Parameters
key
Returns
the attribute with name name or NULL (wrapped as shared pointer) if the attribute with name is not found

Referenced by get_attribute_as().

template<typename T >
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.

Parameters
keythe key of the attribute to look up.
Returns
the value of the attribute

Definition at line 701 of file attributes.hh.

References 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

Parameters
key
Returns
true if attribute exists, false otherwise
CAttributedData& CAttributedData::operator= ( const CAttributedData org)

Assignemt operator.

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)

Parameters
key
attr
void CAttributedData::set_attribute ( const std::string &  key,
const std::string &  value 
)

Set an attribute using one of the defined translators

Parameters
key
value
void CAttributedData::set_attributes ( CAttributeMap::const_iterator  begin,
CAttributeMap::const_iterator  end 
)

Insersts or overwrites the attributes given in the input range

Parameters
begin
end

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