![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
This represents the common interface for message serialization. More...
#include <common.h>
Public Member Functions | |
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... | |
This represents the common interface for message serialization.
Definition at line 447 of file inc/hanfun/common.h.
|
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. |
Implemented in HF::Common::SerializableHelper< std::vector< uint8_t > >, HF::Common::SerializableHelper< std::string >, HF::Common::SerializableHelper< Common::ByteArray >, HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Common::SerializableHelper< T, EnableIf(IsIntegral(T))>, HF::UID::UID, HF::Common::SerializableHelper< T, EnableIf(IsClassPointer(T))>, HF::Common::SerializableHelper< T, typename >, HF::Common::SerializableHelper< int8_t >, HF::Common::SerializableHelper< uint32_t >, HF::Common::SerializableHelper< int16_t >, HF::Common::SerializableHelper< T >, HF::Common::SerializableHelper< HS_Colour >, HF::Common::SerializableHelper< XY_Colour >, HF::Common::SerializableHelper< uint8_t >, HF::Common::SerializableHelper< uint16_t >, HF::Common::SerializableHelper< bool >, HF::UID::URI, 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 >, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, HF::UID::ByteArray< MAC, 6, MAC_UID >, HF::UID::NONE, and HF::UID::UID_T.
|
pure virtual |
Number bytes needed to serialize the message.
Implemented in HF::Common::SerializableHelper< std::vector< uint8_t > >, HF::Common::SerializableHelper< std::string >, HF::Common::SerializableHelper< Common::ByteArray >, HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Common::SerializableHelper< T, EnableIf(IsIntegral(T))>, HF::UID::UID, HF::Common::SerializableHelper< T, EnableIf(IsClassPointer(T))>, HF::Common::SerializableHelper< T, typename >, HF::Common::SerializableHelper< int8_t >, HF::Common::SerializableHelper< uint32_t >, HF::Common::SerializableHelper< int16_t >, HF::Common::SerializableHelper< T >, HF::Common::SerializableHelper< HS_Colour >, HF::Common::SerializableHelper< XY_Colour >, HF::Common::SerializableHelper< uint8_t >, HF::Common::SerializableHelper< uint16_t >, HF::Common::SerializableHelper< bool >, HF::UID::URI, 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 >, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, HF::UID::ByteArray< MAC, 6, MAC_UID >, and HF::UID::UID_T.
|
pure virtual |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Implemented in HF::Common::SerializableHelper< std::vector< uint8_t > >, HF::Common::SerializableHelper< std::string >, HF::Attributes::Attribute< T, _Owner, EnableIf(IsParent(HF::Interface, _Owner))>, HF::Common::SerializableHelper< Common::ByteArray >, HF::Common::SerializableHelper< T, EnableIf(IsIntegral(T))>, HF::UID::UID, HF::Common::SerializableHelper< T, EnableIf(IsClassPointer(T))>, HF::Common::SerializableHelper< T, typename >, HF::Common::SerializableHelper< int8_t >, HF::Common::SerializableHelper< uint32_t >, HF::Common::SerializableHelper< int16_t >, HF::Common::SerializableHelper< T >, HF::Common::SerializableHelper< HS_Colour >, HF::Common::SerializableHelper< XY_Colour >, HF::Common::SerializableHelper< uint8_t >, HF::Common::SerializableHelper< uint16_t >, HF::Common::SerializableHelper< bool >, 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 >, HF::UID::URI, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, HF::UID::ByteArray< MAC, 6, MAC_UID >, HF::UID::NONE, and HF::UID::UID_T.