TAttribute< T > Class Template Reference
Basic data strctures and functions

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]

## Constructors

| TAttribute (typename ::boost::reference_wrapper< T >::type value)
| operator T () const
virtual const char * | typedescr () const
virtual int | type_id () const
const T & | get_value () const

## Additional Inherited Members

Public Member Functions inherited from CAttribute
std::string | as_string () const
| returns the value as a atring
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

## 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 118 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 535 of file attributes.hh.

Referenced by operator T().

## 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 547 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 541 of file attributes.hh.

References TAttribute().

## type_id()

template<typename T>

int TAttribute< T >::type_id | ( |  | ) | const

virtual

Returns
  a type is

Implements CAttribute.

Definition at line 559 of file attributes.hh.

References EAttributeType::attr_unknown, and attribute_type< T >::value.

## 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 553 of file attributes.hh.

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

- attributes.hh