HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Attributes::IAttribute Struct Referenceabstract

Interface/Service Attribute API. More...

#include <attributes.h>

+ Inheritance diagram for HF::Attributes::IAttribute:
+ Collaboration diagram for HF::Attributes::IAttribute:

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...
 
- Public Member Functions inherited from HF::Common::Serializable
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...
 
- Public Member Functions inherited from HF::Common::Cloneable< IAttribute >
virtual IAttribute * clone () const=0
 Create a clone object of the object where this method is being called. More...
 

Detailed Description

Interface/Service Attribute API.

Definition at line 44 of file attributes.h.

Member Function Documentation

◆ changed()

virtual float HF::Attributes::IAttribute::changed ( const IAttribute other) const
pure virtual

◆ compare()

virtual int HF::Attributes::IAttribute::compare ( const IAttribute other) const
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.

Parameters
[in]otherattribute to compare to.
Return values
<0if attribute less than other;
0if attribute equal to other;
>0if 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.

◆ interface()

virtual uint16_t HF::Attributes::IAttribute::interface ( ) const
pure virtual

Return the UID of the interface the attribute belongs to.

Returns
UID of the interface the attribute belongs to.

Implemented in HF::Attributes::AbstractAttribute.

Referenced by HF::Attributes::AbstractAttribute::compare().

+ Here is the caller graph for this function:

◆ isWritable()

virtual bool HF::Attributes::IAttribute::isWritable ( ) const
pure virtual

Indicate if the attribute is writable.

Return values
trueif the attribute is writable,
falseotherwise.

Implemented in HF::Attributes::AbstractAttribute.

◆ owner()

virtual HF::Interface const* HF::Attributes::IAttribute::owner ( ) const
pure virtual

◆ pack()

virtual uint16_t HF::Attributes::IAttribute::pack ( Common::ByteArray array,
uint16_t  offset,
bool  with_uid 
) const
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.,

Parameters
[in,out]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
[in]with_uidinclude uid field in the serialization.
Returns
the number of bytes written.

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 >.

◆ size()

virtual uint16_t HF::Attributes::IAttribute::size ( bool  with_uid) const
pure virtual

◆ uid()

virtual uint8_t HF::Attributes::IAttribute::uid ( ) const
pure virtual

Attribute's UID.

Returns
the attribute's UID value.

Implemented in HF::Attributes::AbstractAttribute.

Referenced by HF::Attributes::AbstractAttribute::compare().

+ Here is the caller graph for this function:

◆ unpack()

virtual uint16_t HF::Attributes::IAttribute::unpack ( const Common::ByteArray array,
uint16_t  offset,
bool  with_uid 
)
pure virtual

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
[in]with_uidtrue if the uid field was included in the serialization, false otherwise.
Returns
the number of bytes read.

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 >.


The documentation for this struct was generated from the following file: