Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::entry::Entry Class Referenceabstract

Communication message abstract entry. More...

#include <entry.h>

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

Public Member Functions

 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...
 
virtual std::vector< uint8_t > Payload (uint8_t &optionIndex) const =0
 Get entity payload. More...
 

Static Public Attributes

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.
 

Protected Member Functions

 Entry (EntryType type, uint16_t serviceId, uint16_t instanceId, uint32_t ttl, uint8_t majorVersion=cAnyMajorVersion) noexcept
 Constructor. More...
 
virtual bool ValidateOption (const option::Option *option) const noexcept
 Validate an option for adding. 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...
 

Detailed Description

Communication message abstract entry.

Constructor & Destructor Documentation

◆ Entry()

ara::com::entry::Entry::Entry ( EntryType  type,
uint16_t  serviceId,
uint16_t  instanceId,
uint32_t  ttl,
uint8_t  majorVersion = cAnyMajorVersion 
)
protectednoexcept

Constructor.

Parameters
typeEntry type
serviceIdService in interest ID
instanceIdService in interest instance ID
ttlEntry time to live
majorVersionService in interest major version

Member Function Documentation

◆ AddFirstOption()

void ara::com::entry::Entry::AddFirstOption ( std::unique_ptr< option::Option firstOption)

Add a first (general) option.

Parameters
firstOptionFirst option to be added

◆ AddSecondOption()

void ara::com::entry::Entry::AddSecondOption ( std::unique_ptr< option::Option secondOption)

Add a second (specific) option.

Parameters
secondOptionSecond option to be added

◆ BasePayload()

std::vector< uint8_t > ara::com::entry::Entry::BasePayload ( uint8_t &  optionIndex) const
protectedvirtual

Get baseentity payload.

Parameters
optionIndexIndex of the last added option
Returns
Byte array

◆ ContainsOption()

bool ara::com::entry::Entry::ContainsOption ( option::OptionType  optionType) const
protectednoexcept

Indicate whether the entry contains a specific option type or not.

Parameters
optionTypeOption type of interest
Returns
True if the entry contains the option; otherwise false

◆ FirstOptions()

const std::vector< std::unique_ptr< option::Option > > & ara::com::entry::Entry::FirstOptions ( ) const
noexcept

Get first (general) options.

Returns
Exisiting first options

◆ InstanceId()

uint16_t ara::com::entry::Entry::InstanceId ( ) const
noexcept

Get instance ID.

Returns
Entry service in interest instance ID

◆ MajorVersion()

uint8_t ara::com::entry::Entry::MajorVersion ( ) const
noexcept

Get major version.

Returns
Entry service in interest major version

◆ Payload()

virtual std::vector< uint8_t > ara::com::entry::Entry::Payload ( uint8_t &  optionIndex) const
pure virtual

Get entity payload.

Parameters
optionIndexIndex of the last added option
Returns
Byte array

Implemented in ara::com::entry::EventgroupEntry, and ara::com::entry::ServiceEntry.

◆ SecondOptions()

const std::vector< std::unique_ptr< option::Option > > & ara::com::entry::Entry::SecondOptions ( ) const
noexcept

Get second (specific) options.

Returns
Exisiting second options

◆ ServiceId()

uint16_t ara::com::entry::Entry::ServiceId ( ) const
noexcept

Get service ID.

Returns
Entry service in interest ID

◆ TTL()

uint32_t ara::com::entry::Entry::TTL ( ) const
noexcept

Get TTL.

Returns
Entry time to live in seconds

◆ Type()

EntryType ara::com::entry::Entry::Type ( ) const
noexcept

Get entry type.

Returns
Entry type

◆ ValidateOption()

bool ara::com::entry::Entry::ValidateOption ( const option::Option option) const
protectedvirtualnoexcept

Validate an option for adding.

Parameters
optionOption of interest
Returns
True if the option is valid; otherwise false

Reimplemented in ara::com::entry::EventgroupEntry, and ara::com::entry::ServiceEntry.