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>
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
typedef BaseType famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::base_type |
typedef detail::HasLessThanRelation::template get_comparator<TagSet>::type famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::comparator |
typedef CompareTag famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::compare_tag |
typedef boost::mpl::integral_c_tag famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::tag |
typedef tags::attribute_tag famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::type_tag |
typedef ValueType famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::value_type |
Constructor & Destructor Documentation
famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::Attribute | ( | ) | [inline, protected] |
Member Function Documentation
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.
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
uint8_t famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::data[detail::AttributeSize< Attribute >::value] |
const bool famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::highDensity [static] |
TagSet::template contains_tag<detail::IsHighDensity>::value
const uint8_t famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::id = ID [static] |
const bool famouso::mw::attributes::Attribute< BaseType, CompareTag, ValueType, Value, ID, TagSet >::requirable [static] |
TagSet::template contains_tag<detail::IsRequirable>::value
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:
- include/mw/attributes/Attribute.h