Entry to subscribe/unsubscribe to/from an event-group.
More...
#include <eventgroup_entry.h>
|
static std::unique_ptr< EventgroupEntry > | CreateSubscribeEventEntry (uint16_t serviceId, uint16_t instanceId, uint8_t majorVersion, uint8_t counter, uint16_t eventgroupId) |
| Subscribe to an event-group entry factory. More...
|
|
static std::unique_ptr< EventgroupEntry > | CreateUnsubscribeEventEntry (uint16_t serviceId, uint16_t instanceId, uint8_t majorVersion, uint8_t counter, uint16_t eventgroupId) |
| Unsubscribe from an event-group entry factory. More...
|
|
static std::unique_ptr< EventgroupEntry > | CreateAcknowledgeEntry (const EventgroupEntry *eventgroupEntry) |
| Positive acknowledge of an event-group entry factory. More...
|
|
static std::unique_ptr< EventgroupEntry > | CreateNegativeAcknowledgeEntry (const EventgroupEntry *eventgroupEntry) |
| Negative acknowledge of an event-group entry factory. More...
|
|
static std::unique_ptr< EventgroupEntry > | Deserialize (const std::vector< uint8_t > &payload, std::size_t &offset, EntryType type, uint16_t serviceId, uint16_t instanceId, uint32_t ttl, uint8_t majorVersion) |
| Deserialize a entry payload. More...
|
|
|
static const uint16_t | cAnyInstanceId = 0xffff |
| Any service instance ID.
|
|
static const uint8_t | cAnyMajorVersion = 0xff |
| Any service major version.
|
|
static const uint8_t | cOptionSizeBitLength = 4 |
| Option number field bit size.
|
|
Entry to subscribe/unsubscribe to/from an event-group.
◆ Counter()
uint8_t ara::com::entry::EventgroupEntry::Counter |
( |
| ) |
const |
|
noexcept |
Get the subscriber counter.
- Returns
- A 4-bit unsinged integer wrapped as a byte
◆ CreateAcknowledgeEntry()
Positive acknowledge of an event-group entry factory.
- Parameters
-
eventgroupEntry | Received subscribe event-group entry |
- Returns
- Acknowledge event-group subscription entry
◆ CreateNegativeAcknowledgeEntry()
Negative acknowledge of an event-group entry factory.
- Parameters
-
eventgroupEntry | Received subscribe event-group entry |
- Returns
- Negative acknowledge event-group subscription entry
◆ CreateSubscribeEventEntry()
std::unique_ptr< EventgroupEntry > ara::com::entry::EventgroupEntry::CreateSubscribeEventEntry |
( |
uint16_t |
serviceId, |
|
|
uint16_t |
instanceId, |
|
|
uint8_t |
majorVersion, |
|
|
uint8_t |
counter, |
|
|
uint16_t |
eventgroupId |
|
) |
| |
|
static |
Subscribe to an event-group entry factory.
- Parameters
-
serviceId | Service in interest ID |
instanceId | Service in interest instance ID |
majorVersion | Service in interest major version |
counter | Counter to distinguish between subscribers |
eventgroupId | Event-group in interest ID |
- Returns
- Subscribe event-group entry
- Exceptions
-
std::out_of_range | Throws if counter is greater than 4 bits |
◆ CreateUnsubscribeEventEntry()
std::unique_ptr< EventgroupEntry > ara::com::entry::EventgroupEntry::CreateUnsubscribeEventEntry |
( |
uint16_t |
serviceId, |
|
|
uint16_t |
instanceId, |
|
|
uint8_t |
majorVersion, |
|
|
uint8_t |
counter, |
|
|
uint16_t |
eventgroupId |
|
) |
| |
|
static |
Unsubscribe from an event-group entry factory.
- Parameters
-
serviceId | Service in interest ID |
instanceId | Service in interest instance ID |
majorVersion | Service in interest major version |
counter | Counter to distinguish between subscribers |
eventgroupId | Event-group in interest ID |
- Returns
- Unsubscribe event-group entry
- Exceptions
-
std::out_of_range | Throws if counter is greater than 4 bits |
◆ Deserialize()
std::unique_ptr< EventgroupEntry > ara::com::entry::EventgroupEntry::Deserialize |
( |
const std::vector< uint8_t > & |
payload, |
|
|
std::size_t & |
offset, |
|
|
EntryType |
type, |
|
|
uint16_t |
serviceId, |
|
|
uint16_t |
instanceId, |
|
|
uint32_t |
ttl, |
|
|
uint8_t |
majorVersion |
|
) |
| |
|
static |
Deserialize a entry payload.
- Parameters
-
payload | Serialized entry payload byte array |
offset | Deserializing offset in the payload |
type | Entry type |
serviceId | Service in interest ID |
instanceId | Service in interest instance ID |
ttl | Entry time to live |
majorVersion | Service in interest major version |
- Returns
- Deserialized entry
- Exceptions
-
std::out_of_range | Throws when the entry type is not an event-group entry |
◆ EventgroupId()
uint16_t ara::com::entry::EventgroupEntry::EventgroupId |
( |
| ) |
const |
|
noexcept |
Get event-group ID.
- Returns
- Event-group ID for subscription/unsubscription
◆ Payload()
std::vector< uint8_t > ara::com::entry::EventgroupEntry::Payload |
( |
uint8_t & |
optionIndex | ) |
const |
|
overridevirtual |
Get entity payload.
- Parameters
-
optionIndex | Index of the last added option |
- Returns
- Byte array
Implements ara::com::entry::Entry.
◆ ValidateOption()
bool ara::com::entry::EventgroupEntry::ValidateOption |
( |
const option::Option * |
option | ) |
const |
|
overrideprotectedvirtualnoexcept |
Validate an option for adding.
- Parameters
-
- Returns
- True if the option is valid; otherwise false
Reimplemented from ara::com::entry::Entry.