![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Interface/Service Attribute API. More...
#include <attributes.h>
Public Member Functions | |
virtual uint8_t | uid () const =0 |
Attribute's UID. More... | |
virtual bool | isWritable () const =0 |
Indicate if the attribute is writable. More... | |
virtual uint16_t | interface () const =0 |
Return the UID of the interface the attribute belongs to. More... | |
virtual HF::Interface const * | owner () const =0 |
Pointer to the interface that owns this attribute. More... | |
virtual uint16_t | size (bool with_uid) const =0 |
Number bytes needed to serialize the message. More... | |
virtual uint16_t | pack (Common::ByteArray &array, uint16_t offset, bool with_uid) const =0 |
Write the object on to a ByteArray so it can be sent over the network. More... | |
virtual uint16_t | unpack (const Common::ByteArray &array, uint16_t offset, bool with_uid)=0 |
Read a message from a ByteArray. More... | |
virtual float | changed (const IAttribute &other) const =0 |
This method is used to get the percentage of change that the attribute has in relation to the value present in other . More... | |
virtual int | compare (const IAttribute &other) const =0 |
Compare this attribute with the given attribute in other . More... | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
virtual uint16_t | size () const =0 |
Number bytes needed to serialize the message. More... | |
virtual uint16_t | pack (ByteArray &array, uint16_t offset=0) const =0 |
Write the object on to a ByteArray so it can be sent over the network. More... | |
virtual uint16_t | unpack (const ByteArray &array, uint16_t offset=0)=0 |
Read a message from a ByteArray. More... | |
![]() | |
virtual IAttribute * | clone () const=0 |
Create a clone object of the object where this method is being called. More... | |
Interface/Service Attribute API.
Definition at line 44 of file attributes.h.
|
pure virtual |
This method is used to get the percentage of change that the attribute has in relation to the value present in other
.
[in] | other | attribute holding a previous value. |
Implemented in HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Attributes::Attribute< T, _Owner, typename >, HF::Attributes::Attribute< int8_t >, HF::Attributes::Attribute< uint32_t >, HF::Attributes::Attribute< int16_t >, HF::Attributes::Attribute< HS_Colour >, HF::Attributes::Attribute< XY_Colour >, HF::Attributes::Attribute< uint8_t >, HF::Attributes::Attribute< uint16_t >, and HF::Attributes::Attribute< bool >.
|
pure virtual |
Compare this attribute with the given attribute in other
.
This method should return < 0 if this attribute is less that, 0 if it is equal and > 0 if greater that the other
attribute.
[in] | other | attribute to compare to. |
<0 | if attribute less than other ; |
0 | if attribute equal to other ; |
>0 | if attribute greater than other . |
Implemented in HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Attributes::Attribute< T, _Owner, typename >, HF::Attributes::Attribute< int8_t >, HF::Attributes::Attribute< uint32_t >, HF::Attributes::Attribute< int16_t >, HF::Attributes::Attribute< HS_Colour >, HF::Attributes::Attribute< XY_Colour >, HF::Attributes::Attribute< uint8_t >, HF::Attributes::Attribute< uint16_t >, HF::Attributes::Attribute< bool >, and HF::Attributes::AbstractAttribute.
|
pure virtual |
Return the UID of the interface the attribute belongs to.
Implemented in HF::Attributes::AbstractAttribute.
Referenced by HF::Attributes::AbstractAttribute::compare().
|
pure virtual |
Indicate if the attribute is writable.
true | if the attribute is writable, |
false | otherwise. |
Implemented in HF::Attributes::AbstractAttribute.
|
pure virtual |
Pointer to the interface that owns this attribute.
This can return nullptr if the attribute was created for a remote interface.
Implemented in HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Attributes::Attribute< T, _Owner, typename >, HF::Attributes::Attribute< int8_t >, HF::Attributes::Attribute< uint32_t >, HF::Attributes::Attribute< int16_t >, HF::Attributes::Attribute< HS_Colour >, HF::Attributes::Attribute< XY_Colour >, HF::Attributes::Attribute< uint8_t >, HF::Attributes::Attribute< uint16_t >, and HF::Attributes::Attribute< bool >.
|
pure virtual |
Write the object on to a ByteArray so it can be sent over the network.
The buffer passed in MUST have enough size to hold the serialized object, e.g.,
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
[in] | with_uid | include uid field in the serialization. |
Implemented in HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Attributes::Attribute< T, _Owner, typename >, HF::Attributes::Attribute< int8_t >, HF::Attributes::Attribute< uint32_t >, HF::Attributes::Attribute< int16_t >, HF::Attributes::Attribute< HS_Colour >, HF::Attributes::Attribute< XY_Colour >, HF::Attributes::Attribute< uint8_t >, HF::Attributes::Attribute< uint16_t >, and HF::Attributes::Attribute< bool >.
|
pure virtual |
Number bytes needed to serialize the message.
[in] | with_uid | include uid size in the calculation. |
Implemented in HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Attributes::Attribute< T, _Owner, typename >, HF::Attributes::Attribute< int8_t >, HF::Attributes::Attribute< uint32_t >, HF::Attributes::Attribute< int16_t >, HF::Attributes::Attribute< HS_Colour >, HF::Attributes::Attribute< XY_Colour >, HF::Attributes::Attribute< uint8_t >, HF::Attributes::Attribute< uint16_t >, and HF::Attributes::Attribute< bool >.
|
pure virtual |
Implemented in HF::Attributes::AbstractAttribute.
Referenced by HF::Attributes::AbstractAttribute::compare().
|
pure virtual |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
[in] | with_uid | true if the uid field was included in the serialization, false otherwise. |
Implemented in HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Attributes::Attribute< T, _Owner, typename >, HF::Attributes::Attribute< int8_t >, HF::Attributes::Attribute< uint32_t >, HF::Attributes::Attribute< int16_t >, HF::Attributes::Attribute< HS_Colour >, HF::Attributes::Attribute< XY_Colour >, HF::Attributes::Attribute< uint8_t >, HF::Attributes::Attribute< uint16_t >, and HF::Attributes::Attribute< bool >.