TAttribute< T > Class Template Reference

Class of an attribute that holds data of type T. More...

#include <mia/core/attributes.hh>

Inheritance diagram for TAttribute< T >:
[legend]
Collaboration diagram for TAttribute< T >:
[legend]

Public Member Functions

 operator T () const
 
virtual int type_id () const
 
virtual const char * typedescr () const
 
Constructors
 TAttribute (typename ::boost::reference_wrapper< T >::type value)
 
- Public Member Functions inherited from CAttribute
std::string as_string () const
 returns the value as a atring More...
 
bool is_equal (const CAttribute &other) const
 
bool is_less (const CAttribute &other) const
 
virtual ~CAttribute ()
 virtual destructor since derived classes may define dynamic objetcs More...
 

Protected Member Functions

const T & get_value () const
 

Detailed Description

template<typename T>
class TAttribute< T >

Class of an attribute that holds data of type T.

This class is the templated derivative of CAttribute that provides the container for most attributes you will come across. The value is stored read-only. It implements implements the abstract methods typedescr, do_as_string, do_is_equal, do_is_less For this type, is_equal returns true if the other attribute has the same type and holds the same value. is_less returns true of either the type is equal and the value is less, or with different types if a string-compare strcmp between the type descriptions returns -1.

Definition at line 116 of file attributes.hh.

Constructor & Destructor Documentation

◆ TAttribute()

template<typename T >
TAttribute< T >::TAttribute ( typename ::boost::reference_wrapper< T >::type  value)

Construct the attribute by setting its value to

Parameters
value

Definition at line 526 of file attributes.hh.

Member Function Documentation

◆ get_value()

template<typename T >
const T & TAttribute< T >::get_value ( ) const
protected
Returns
the value of the attribute

Definition at line 538 of file attributes.hh.

◆ operator T()

template<typename T >
TAttribute< T >::operator T ( ) const

provide a transparent conversion to the content type

Remarks
should we really use this?

Definition at line 532 of file attributes.hh.

◆ type_id()

template<typename T >
int TAttribute< T >::type_id ( ) const
virtual
Returns
a type is

Implements CAttribute.

Definition at line 550 of file attributes.hh.

References EAttributeType::attr_unknown.

◆ typedescr()

template<typename T >
const char * TAttribute< T >::typedescr ( ) const
virtual
Returns
typeid(T).name(), and is, therefore, dependend on the compiler

Implements CAttribute.

Definition at line 544 of file attributes.hh.

Referenced by CAttributedData::set_attribute().


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