HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Profiles::ProfileN< _uid, _Interfaces > Class Template Referenceabstract

Class template for profiles containing multiple interfaces. More...

#include <profiles.h>

+ Inheritance diagram for HF::Profiles::ProfileN< _uid, _Interfaces >:
+ Collaboration diagram for HF::Profiles::ProfileN< _uid, _Interfaces >:

Public Member Functions

Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
virtual void send (const Protocol::Address &addr, Protocol::Message &message)=0
 Send message msg to the network address given by addr. More...
 
virtual void notify (const HF::Attributes::IAttribute &old_value, const HF::Attributes::IAttribute &new_value) const =0
 Notify that an attribute value as changed. More...
 
HF::Attributes::List attributes (Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Return a list of all the attributes for a given interface, pack id and list of attributes UID's. More...
 
- Public Member Functions inherited from HF::Profiles::AbstractProfile< _uid >
uint16_t uid () const
 Return this profile HAN-FUN UID. More...
 
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
- Public Member Functions inherited from HF::Interfaces::Container< ProfileN< _uid, _Interfaces... >, HF::Interfaces::Proxy< _Interfaces, ProfileN< _uid, _Interfaces... > >... >
 Container (ProfileN< _uid, _Interfaces... > &base)
 Constructor. More...
 
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
void attributes (HF::Attributes::List &attr_list, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Return a list of all the attributes for a given interface, pack id and list of attributes UID's. More...
 
std::vector< Common::Interfaceinterfaces () const
 Return the list of interfaces present in the wrapper. More...
 
const std::tuple_element< N, interfaces_t >::type::base * get () const
 Retrieve a pointer to the N optional interface implemented by this unit. More...
 

Additional Inherited Members

- Protected Member Functions inherited from HF::Interfaces::Container< ProfileN< _uid, _Interfaces... >, HF::Interfaces::Proxy< _Interfaces, ProfileN< _uid, _Interfaces... > >... >
void for_each (std::function< void(HF::Interface &)> func) const
 Call the given function for all the interfaces. More...
 
void for_each (std::function< void(HF::Interface &)> func)
 Call the given function for all the interfaces. More...
 
void for_each (std::function< void(HF::Interface &)> func) const
 Helper template function to implement the HF::Units::Unit::for_each functionality. More...
 
void for_each (std::function< void(HF::Interface &)> func) const
 Helper template function to implement the HF::Units::Unit::for_each functionality. More...
 
HF::Interfacefind (uint16_t itf_uid) const
 Find the interface with the given UID. More...
 
HF::Interfacefind (uint16_t itf_uid) const
 Final template instantiation that finds the wrapped interface with the given UID. More...
 
void attributes_itf (HF::Attributes::List &attrs, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Helper function used to provide HF::Units::Unit::attributes functionality. More...
 
void attributes_itf (HF::Attributes::List &attrs, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Helper function used to provide HF::Units::Unit::attributes functionality. More...
 

Detailed Description

template<uint16_t _uid, typename... _Interfaces>
class HF::Profiles::ProfileN< _uid, _Interfaces >

Class template for profiles containing multiple interfaces.

Definition at line 332 of file profiles.h.

Member Function Documentation

◆ attributes()

template<uint16_t _uid, typename... _Interfaces>
HF::Attributes::List HF::Profiles::ProfileN< _uid, _Interfaces >::attributes ( Common::Interface  itf,
uint8_t  pack_id,
const HF::Attributes::UIDS uids 
) const
inlinevirtual

Return a list of all the attributes for a given interface, pack id and list of attributes UID's.

Parameters
[in]itfinterface UID.
[in]pack_idattribute pack id.
[in]uidslist of attributes UID's.
Returns
attribute list.

Reimplemented from HF::Profiles::AbstractProfile< _uid >.

Definition at line 364 of file profiles.h.

366  {
367  HF::Attributes::List result;
368 
369  container_t::attributes(result, itf, pack_id, uids);
370 
371  return result;
372  }
This class has the same behavior has a list, however the list element access methods where overwritte...
Definition: attributes.h:752
void attributes(HF::Attributes::List &attr_list, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
Return a list of all the attributes for a given interface, pack id and list of attributes UID&#39;s...
Definition: interface.h:483

◆ handle()

template<uint16_t _uid, typename... _Interfaces>
Common::Result HF::Profiles::ProfileN< _uid, _Interfaces >::handle ( Protocol::Packet packet,
Common::ByteArray payload,
uint16_t  offset 
)
inline

Handle incoming messages from the network.

Parameters
[in]packetthe packet receive from the network.
[in]payloadthe byte array containing the data received from the network.
[in]offsetthe offset the payload start at in the byte array.
Returns
the result of the message processing.

Definition at line 350 of file profiles.h.

352  {
353  return container_t::handle(packet, payload, offset);
354  }
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Definition: interface.h:463

◆ notify()

template<uint16_t _uid, typename... _Interfaces>
virtual void HF::Profiles::ProfileN< _uid, _Interfaces >::notify ( const HF::Attributes::IAttribute old_value,
const HF::Attributes::IAttribute new_value 
) const
pure virtual

Notify that an attribute value as changed.

Parameters
[in]old_valueattribute's old value.
[in]new_valueattribute's new value.

◆ send()

template<uint16_t _uid, typename... _Interfaces>
virtual void HF::Profiles::ProfileN< _uid, _Interfaces >::send ( const Protocol::Address addr,
Protocol::Message message 
)
pure virtual

Send message msg to the network address given by addr.

Parameters
[in]addrHF network address.
[in]messagepointer to the message to be sent to the network.

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