![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
This class represents a group of devices. More...
#include <group_management.h>
Public Member Functions | |
Group (uint16_t address=0, std::string name="") | |
Constructor. More... | |
const Container & | members () const |
Return a reference to the members of the group. More... | |
Container::iterator | find_member (const Member &member) |
Find a group member equal to the given member . More... | |
Container::iterator | find_member (uint16_t device, uint8_t unit) |
Find a group member equal to the given member . More... | |
bool | exists (const Member &member) |
Check if a member equal to the given member already exists in the group. More... | |
bool | exists (uint16_t device, uint8_t unit) |
Check if a member equal to the given member already exists in the group. More... | |
bool | add (const Member &member) |
Add the given member to the group. More... | |
bool | add (uint16_t device, uint8_t unit) |
Add the given member to the group. More... | |
bool | reserve () |
Reserve a member in group members entries. More... | |
bool | update (const Member &member) |
Update a reserved entry with the given member . More... | |
bool | update (uint16_t device, uint8_t unit) |
Update a reserved entry with the given member . More... | |
bool | remove (const Member &member) |
Remove the given member from the entries of the group. More... | |
bool | remove (uint16_t device, uint8_t unit) |
Remove the given member from the entries of the group. More... | |
bool | operator== (const Group &other) const |
Equals operator. | |
bool | operator!= (const Group &other) const |
Not equals operator. | |
![]() | |
GroupAddress (uint16_t address=0) | |
Constructor. More... | |
uint16_t | size () const |
Number bytes needed to serialize the message. 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=0) |
Read a message from a ByteArray. More... | |
Data Fields | |
std::string | name |
Group Name | |
![]() | |
uint16_t | address |
Group Address | |
Protected Attributes | |
Container | _members |
Group Members | |
Additional Inherited Members | |
![]() | |
static constexpr uint16_t | NO_ADDR = 0x0000 |
Empty Group Address. More... | |
static constexpr uint16_t | START_ADDR = 0x0001 |
First HAN-FUN Group Address. More... | |
static constexpr uint16_t | END_ADDR = 0x7FFF |
Last HAN-FUN Group Address. More... | |
static constexpr uint16_t | min_size = sizeof(uint16_t) |
Minimum pack/unpack required data size. | |
This class represents a group of devices.
Definition at line 145 of file group_management.h.
|
inline |
Constructor.
[in] | address | the group's address. |
[in] | name | the group's name. |
Definition at line 166 of file group_management.h.
bool HF::Core::GroupManagement::Group::add | ( | const Member & | member | ) |
Add the given member
to the group.
[in] | member | reference to a member to add to the group. |
true | if the member was added; |
false | otherwise. |
Referenced by add().
|
inline |
Add the given member
to the group.
[in] | device | device address for the new member to add. |
[in] | unit | unit ID for the new member to add. |
true | if the member was added; |
false | otherwise. |
Definition at line 259 of file group_management.h.
References add().
|
inline |
Check if a member equal to the given member
already exists in the group.
[in] | member | reference to the member to check presence of. |
true | if the member is already present in the group; |
false | otherwise. |
Definition at line 219 of file group_management.h.
References find_member(), and members().
|
inline |
Check if a member equal to the given member
already exists in the group.
[in] | device | device address to check the existence for. |
[in] | unit | unit ID to check the existence for. |
true | if the member is already present in the group; |
false | otherwise. |
Definition at line 233 of file group_management.h.
References find_member(), and members().
Container::iterator HF::Core::GroupManagement::Group::find_member | ( | const Member & | member | ) |
Find a group member equal to the given member
.
[in] | member | reference to a Member instance to look for. |
iterator | to the element in the Container if exists, |
Container::end() | otherwise. |
Referenced by exists(), and find_member().
|
inline |
Find a group member equal to the given member
.
[in] | device | device address for the member to look for. |
[in] | unit | unit ID for the member to look for. |
iterator | to the element in the Container if exists, |
Container::end() | otherwise. |
Definition at line 203 of file group_management.h.
References find_member().
|
inline |
Return a reference to the members of the group.
Definition at line 179 of file group_management.h.
References _members.
Referenced by exists(), and reserve().
bool HF::Core::GroupManagement::Group::remove | ( | const Member & | member | ) |
Remove the given member
from the entries of the group.
[in] | member | reference to the member to remove from the group. |
true | if the entry was removed; |
false | otherwise. |
|
inline |
Remove the given member
from the entries of the group.
device | device address of the member to remove. |
unit | unit ID of the member to remove. |
true | if the entry was removed; |
false | otherwise. |
Definition at line 324 of file group_management.h.
|
inline |
Reserve a member in group members entries.
true | if the entry was reserved; |
false | otherwise. |
Definition at line 272 of file group_management.h.
References _members, HF_ASSERT, members(), and HF::Core::GroupManagement::GroupAddress::size().
bool HF::Core::GroupManagement::Group::update | ( | const Member & | member | ) |
Update a reserved entry with the given member
.
[in] | member | reference to the member to update the reserved entry to. |
true | if the entry was updated; |
false | otherwise. |
Referenced by update().
|
inline |
Update a reserved entry with the given member
.
device | device address to update the reserved entry with. |
unit | unit ID to update the reserved entry with. |
true | if the entry was updated; |
false | otherwise. |
Definition at line 298 of file group_management.h.
References update().