Menu

famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet > Class Template Reference

Represents an attribute as a part of the FAMOUSO generic attribute framework. More...

#include <Attribute.h>

Inheritance diagram for famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >:
famouso::mw::attributes::access::Attribute_RT famouso::mw::attributes::access::AttributeHeader_RT famouso::mw::attributes::AbsoluteDeadline< deadline > famouso::mw::attributes::Period< period > famouso::mw::attributes::RelativeDeadline< deadline >

Data Structures

struct  isStronger

Public Types

typedef boost::mpl::integral_c_tag tag
typedef tags::attribute_tag type_tag
typedef CompareTag compare_tag
typedef BaseType base_type
typedef ValueType value_type
typedef
detail::HasLessThanRelation::template
get_comparator< TagSet >::type 
comparator

Public Member Functions

const ValueType getValue () const
 Returns the value from the binary representation of this attribute instance.
const bool setValue (const ValueType newValue)
 Sets the value in the binary representation of this attribute to the given one.

Data Fields

uint8_t data [detail::AttributeSize< Attribute >::value]

Static Public Attributes

static const ValueType value = Value
static const uint8_t id = ID
static const bool highDensity
static const bool requirable

Protected Member Functions

 Attribute ()

Detailed Description

template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
class famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >

Represents an attribute as a part of the FAMOUSO generic attribute framework.

This is the central entity of the attribute framework. It can be attached to disseminated events in order to be transmitted in a compact binary representation. Further attributes can also be attached to event channels and network driver implementation to provide means for performing compile time composability checks. Attribute attachment is generally done using type lists containing the specific attribute types.

An attribute is defined by being either a high density or low density attribute and having a specific identifier. Related to this unique type an attribute has a specific value type describing the range of values it can have.

An attribute class always has the value attached which was provided at compile time. This value is used when an instance of the specific class is created and the attribute is written to its binary representation. Nevertheless the runtime value, i.e. the value contained in the binary representation, can be accessed and, with limitations, even changed.

The given base type is used for determining whether two given attributes should be considered equal, that is of the same type. Since template classes with bound parameters always yield different types for different arguments, the plain type itself would not be considered as equal.

Template Parameters:
BaseType The type which is used to compare attributes of the same type
CompareTag The tag which defines how this attribute can be compared
ValueType The type of this attribute's value
Value The compile time value of this attribute
Comparator The filter expression struct defining how attributes of this type are compared, i.e. which are better than others
ID The identifier of this attribute
TagSet The tags attached to this attribute, an empty tag set by default

Member Typedef Documentation

template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
typedef BaseType famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::base_type
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
typedef detail::HasLessThanRelation::template get_comparator<TagSet>::type famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::comparator
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
typedef CompareTag famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::compare_tag
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
typedef boost::mpl::integral_c_tag famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::tag
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
typedef tags::attribute_tag famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::type_tag
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
typedef ValueType famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::value_type

Constructor & Destructor Documentation

template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::Attribute (  )  [inline, protected]

Member Function Documentation

template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
const ValueType famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::getValue (  )  const [inline]

Returns the value from the binary representation of this attribute instance.

The value is parsed from the binary representation of this attribute. That means this attribute's static properties are not used at all.

Template Parameters:
ValueType The type of this attribute's value
Returns:
This attribute's value

Reimplemented from famouso::mw::attributes::access::Attribute_RT.

template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
const bool famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::setValue ( const ValueType  newValue  )  [inline]

Sets the value in the binary representation of this attribute to the given one.

Since the binary representation of attribute's value has some restrictions in size it could be the case that it is not possible to apply the given value. This could for example be the case if the current value is written unextended and the new value would demand to be written extended.

Template Parameters:
ValueType The type of this attribute's value
Parameters:
newValue The new value to set
Returns:
True if the value could properly be set, false if the value could not be set and the attribute keeps its previous value

Reimplemented from famouso::mw::attributes::access::Attribute_RT.


Field Documentation

template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
uint8_t famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::data[detail::AttributeSize< Attribute >::value]
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
const bool famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::highDensity [static]
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
const uint8_t famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::id = ID [static]
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
const bool famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::requirable [static]
Initial value:
                            TagSet::template contains_tag<detail::IsRequirable>::value
template<typename BaseType, typename CompareTag, typename ValueType, ValueType Value, uint8_t ID, typename TagSet = detail::TagSet<>>
const ValueType famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::value = Value [static]

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