![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Helper template class to declare an attribute with the given T
type.
More...
#include <attributes.h>
Public Member Functions | |
Attribute (const uint16_t interface, const uint8_t uid, const HF::Interface *__owner, T data, bool writable=false) | |
Attribute template constructor. More... | |
Attribute (const uint16_t interface, const uint8_t uid, bool writable=false) | |
Attribute template constructor. More... | |
Attribute (const uint16_t interface, const uint8_t uid, T data, bool writable=false) | |
Attribute template constructor. More... | |
HF::Interface const * | owner () const |
Pointer to the interface that owns this attribute. More... | |
uint16_t | size (bool with_uid) const |
Number bytes needed to serialize the message. More... | |
uint16_t | size () const |
Number bytes needed to serialize the message. More... | |
uint16_t | pack (Common::ByteArray &array, uint16_t offset, bool with_uid) const |
Write the object on to a ByteArray so it can be sent over the network. More... | |
uint16_t | pack (Common::ByteArray &array, uint16_t offset=0) const |
Write the object on to a ByteArray so it can be sent over the network. More... | |
uint16_t | unpack (const Common::ByteArray &array, uint16_t offset, bool with_uid) |
Read a message from a ByteArray. More... | |
uint16_t | unpack (const Common::ByteArray &array, uint16_t offset=0) |
Read a message from a ByteArray. More... | |
IAttribute * | clone () const |
Create a clone object of the object where this method is being called. More... | |
int | compare (const IAttribute &other) const |
Compare this attribute with the given attribute in other . More... | |
float | changed (const IAttribute &other) const |
This method is used to get the percentage of change that the attribute has in relation to the value present in other . More... | |
![]() | |
uint8_t | uid () const |
Attribute's UID. More... | |
bool | isWritable () const |
Indicate if the attribute is writable. More... | |
uint16_t | interface () const |
Return the UID of the interface the attribute belongs to. More... | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
Additional Inherited Members | |
![]() | |
const uint16_t | _itf_uid |
Interface this attribute belongs to. More... | |
const uint8_t | _uid |
Attribute unique identifier. More... | |
const bool | _writable |
Attribute access mode. More... | |
Helper template class to declare an attribute with the given T
type.
T | underling data type for the attribute. |
_Owner | underling data type for the attribute's owner. |
Definition at line 349 of file attributes.h.
|
inline |
Attribute template constructor.
[in] | interface | attribute's interface UID. |
[in] | uid | attribute's UID. |
[in] | data | attribute's value. |
[in] | __owner | pointer to attribute's interface owner object. |
[in] | writable | attribute's writable information. |
Definition at line 360 of file attributes.h.
|
inline |
Attribute template constructor.
[in] | interface | attribute's interface UID. |
[in] | uid | attribute's UID. |
[in] | writable | attribute's writable information. |
Definition at line 372 of file attributes.h.
|
inline |
Attribute template constructor.
[in] | interface | attribute's interface UID. |
[in] | uid | attribute's UID. |
[in] | data | attribute's value. |
[in] | writable | attribute's writable information. |
Definition at line 384 of file attributes.h.
|
inlinevirtual |
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. |
Implements HF::Attributes::IAttribute.
Definition at line 496 of file attributes.h.
|
inlinevirtual |
Create a clone object of the object where this method is being called.
Implements HF::Common::Cloneable< IAttribute >.
Definition at line 477 of file attributes.h.
|
inlinevirtual |
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 . |
Reimplemented from HF::Attributes::AbstractAttribute.
Definition at line 483 of file attributes.h.
|
inlinevirtual |
Pointer to the interface that owns this attribute.
This can return nullptr if the attribute was created for a remote interface.
Implements HF::Attributes::IAttribute.
Definition at line 414 of file attributes.h.
|
inlinevirtual |
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. |
Implements HF::Attributes::IAttribute.
Definition at line 429 of file attributes.h.
|
inlinevirtual |
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. |
Implements HF::Common::Serializable.
Definition at line 445 of file attributes.h.
|
inlinevirtual |
Number bytes needed to serialize the message.
[in] | with_uid | include uid size in the calculation. |
Implements HF::Attributes::IAttribute.
Definition at line 419 of file attributes.h.
|
inlinevirtual |
Number bytes needed to serialize the message.
Implements HF::Common::Serializable.
Definition at line 424 of file attributes.h.
Referenced by HF::Attributes::Attribute< bool >::pack(), HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>::pack(), HF::Attributes::Attribute< bool >::size(), HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>::size(), HF::Attributes::Attribute< bool >::unpack(), and HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>::unpack().
|
inlinevirtual |
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. |
Implements HF::Attributes::IAttribute.
Definition at line 450 of file attributes.h.
|
inlinevirtual |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Implements HF::Common::Serializable.
Definition at line 472 of file attributes.h.