![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Wrapper around UID_T pointer's. More...
#include <uids.h>
Public Member Functions | |
UID (UID_T *_uid, bool _owner=false) | |
Constructor. More... | |
UID (UID &&other) | |
Move constructor. More... | |
UID (const UID &other) | |
Copy constructor. More... | |
uint8_t | type () const |
Type of the UID. More... | |
uint16_t | size () const |
Number bytes needed to serialize the message. More... | |
uint16_t | pack (Common::ByteArray &array, uint16_t offset) 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) |
Read a message from a ByteArray. More... | |
UID & | operator= (const UID &other) |
Copy assignment operator. More... | |
UID & | operator= (UID &&other) |
Move assignment operator. More... | |
UID & | operator= (UID_T *_uid) |
Use the given pointer as the pointer of the underlining UID to wrap around of. More... | |
int | compare (const UID &other) const |
Compare the current UID with the given UID. More... | |
int | compare (const UID_T &other) const |
Compare the current UID with the given UID. More... | |
UID_T const * | raw () const |
Get the underling wrapped UID_T pointer. More... | |
float | changed (const UID &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... | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
Wrapper around UID_T pointer's.
This class can either wrap an existing pointer (i.e. a pointer to an object it doesn't own) or wrap a pointer to an object that was created based on an existing object. In this case the clone object is owned by this class instance.
The destructor of this class will delete
the object it owns.
|
inline |
|
inline |
|
inline |
|
inline |
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. |
Definition at line 710 of file uids.h.
References UNUSED.
|
inline |
Compare the current UID with the given UID.
This function returns a value less that 0 if the current UID object order is lower that the given UID, 0 if the UIDs represent the same entity and a value greater that 0 if current UID object is above the given UID.
[in] | other | a pointer to a UID object to compare to. |
<0 | the current UID is lower that the given UID. |
0 | the current UID is the same as given UID. |
>0 | the current UID is greater that the given UID. |
Definition at line 688 of file uids.h.
References HF::UID::UID_T::compare().
|
inline |
Compare the current UID with the given UID.
This function returns a value less that 0 if the current UID object order is lower that the given UID, 0 if the UIDs represent the same entity and a value greater that 0 if current UID object is above the given UID.
[in] | other | a pointer to a UID object to compare to. |
<0 | the current UID is lower that the given UID. |
0 | the current UID is the same as given UID. |
>0 | the current UID is greater that the given UID. |
Definition at line 694 of file uids.h.
References HF::UID::UID_T::compare().
Copy assignment operator.
[in] | other | UID to copy from. |
Definition at line 627 of file uids.h.
References HF::Common::Cloneable< T >::clone().
|
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 609 of file uids.h.
References HF::UID::UID_T::pack().
Referenced by hello_msg_t::pack().
|
inline |
|
inlinevirtual |
Number bytes needed to serialize the message.
Implements HF::Common::Serializable.
Definition at line 604 of file uids.h.
References HF::UID::UID_T::size().
Referenced by hello_msg_t::size().
|
inline |
Type of the UID.
Definition at line 589 of file uids.h.
References HF::UID::UID_T::type().
|
virtual |
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.
Referenced by hello_msg_t::unpack().