Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::entry::EventgroupEntry Class Reference

Entry to subscribe/unsubscribe to/from an event-group. More...

#include <eventgroup_entry.h>

Inheritance diagram for ara::com::entry::EventgroupEntry:
ara::com::entry::Entry

Public Member Functions

 EventgroupEntry (EventgroupEntry &&other)
 
EventgroupEntryoperator= (EventgroupEntry &&other)
 
uint8_t Counter () const noexcept
 Get the subscriber counter. More...
 
uint16_t EventgroupId () const noexcept
 Get event-group ID. More...
 
virtual std::vector< uint8_t > Payload (uint8_t &optionIndex) const override
 Get entity payload. More...
 
- Public Member Functions inherited from ara::com::entry::Entry
 Entry (Entry &&other)
 
Entryoperator= (Entry &&other)
 
EntryType Type () const noexcept
 Get entry type. More...
 
uint16_t ServiceId () const noexcept
 Get service ID. More...
 
uint16_t InstanceId () const noexcept
 Get instance ID. More...
 
uint8_t MajorVersion () const noexcept
 Get major version. More...
 
uint32_t TTL () const noexcept
 Get TTL. More...
 
const std::vector< std::unique_ptr< option::Option > > & FirstOptions () const noexcept
 Get first (general) options. More...
 
void AddFirstOption (std::unique_ptr< option::Option > firstOption)
 Add a first (general) option. More...
 
const std::vector< std::unique_ptr< option::Option > > & SecondOptions () const noexcept
 Get second (specific) options. More...
 
void AddSecondOption (std::unique_ptr< option::Option > secondOption)
 Add a second (specific) option. More...
 

Static Public Member Functions

static std::unique_ptr< EventgroupEntryCreateSubscribeEventEntry (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< EventgroupEntryCreateUnsubscribeEventEntry (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< EventgroupEntryCreateAcknowledgeEntry (const EventgroupEntry *eventgroupEntry)
 Positive acknowledge of an event-group entry factory. More...
 
static std::unique_ptr< EventgroupEntryCreateNegativeAcknowledgeEntry (const EventgroupEntry *eventgroupEntry)
 Negative acknowledge of an event-group entry factory. More...
 
static std::unique_ptr< EventgroupEntryDeserialize (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...
 

Protected Member Functions

virtual bool ValidateOption (const option::Option *option) const noexcept override
 Validate an option for adding. More...
 
- Protected Member Functions inherited from ara::com::entry::Entry
 Entry (EntryType type, uint16_t serviceId, uint16_t instanceId, uint32_t ttl, uint8_t majorVersion=cAnyMajorVersion) noexcept
 Constructor. More...
 
bool ContainsOption (option::OptionType optionType) const noexcept
 Indicate whether the entry contains a specific option type or not. More...
 
virtual std::vector< uint8_t > BasePayload (uint8_t &optionIndex) const
 Get baseentity payload. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ara::com::entry::Entry
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.
 

Detailed Description

Entry to subscribe/unsubscribe to/from an event-group.

Member Function Documentation

◆ 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()

std::unique_ptr< EventgroupEntry > ara::com::entry::EventgroupEntry::CreateAcknowledgeEntry ( const EventgroupEntry eventgroupEntry)
static

Positive acknowledge of an event-group entry factory.

Parameters
eventgroupEntryReceived subscribe event-group entry
Returns
Acknowledge event-group subscription entry

◆ CreateNegativeAcknowledgeEntry()

std::unique_ptr< EventgroupEntry > ara::com::entry::EventgroupEntry::CreateNegativeAcknowledgeEntry ( const EventgroupEntry eventgroupEntry)
static

Negative acknowledge of an event-group entry factory.

Parameters
eventgroupEntryReceived 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
serviceIdService in interest ID
instanceIdService in interest instance ID
majorVersionService in interest major version
counterCounter to distinguish between subscribers
eventgroupIdEvent-group in interest ID
Returns
Subscribe event-group entry
Exceptions
std::out_of_rangeThrows 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
serviceIdService in interest ID
instanceIdService in interest instance ID
majorVersionService in interest major version
counterCounter to distinguish between subscribers
eventgroupIdEvent-group in interest ID
Returns
Unsubscribe event-group entry
Exceptions
std::out_of_rangeThrows 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
payloadSerialized entry payload byte array
offsetDeserializing offset in the payload
typeEntry type
serviceIdService in interest ID
instanceIdService in interest instance ID
ttlEntry time to live
majorVersionService in interest major version
Returns
Deserialized entry
Exceptions
std::out_of_rangeThrows 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
optionIndexIndex 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
optionOption of interest
Returns
True if the option is valid; otherwise false

Reimplemented from ara::com::entry::Entry.