Entry to find and offer a service.
More...
#include <service_entry.h>
|
static std::unique_ptr< ServiceEntry > | CreateFindServiceEntry (uint16_t serviceId, uint32_t ttl=cInfiniteTtl, uint16_t instanceId=cAnyInstanceId, uint8_t majorVersion=cAnyMajorVersion, uint32_t minorVersion=cAnyMinorVersion) |
| Find a service entry factory. More...
|
|
static std::unique_ptr< ServiceEntry > | CreateOfferServiceEntry (uint16_t serviceId, uint16_t instanceId, uint8_t majorVersion, uint32_t minorVersion, uint32_t ttl=cInfiniteTtl) |
| Offer a service entry factory. More...
|
|
static std::unique_ptr< ServiceEntry > | CreateStopOfferEntry (uint16_t serviceId, uint16_t instanceId, uint8_t majorVersion, uint32_t minorVersion) noexcept |
| Stop offer a service entry factory. More...
|
|
static std::unique_ptr< ServiceEntry > | 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 uint32_t | cAnyMinorVersion = 0xffffffff |
| Any service minor version.
|
|
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 find and offer a service.
◆ CreateFindServiceEntry()
Find a service entry factory.
- Parameters
-
serviceId | Service in interest ID |
ttl | Entry time to live |
instanceId | Service in interest instance ID |
majorVersion | Service in interest major version |
minorVersion | Service in interest minor version |
- Returns
- Find service entry
◆ CreateOfferServiceEntry()
std::unique_ptr< ServiceEntry > ara::com::entry::ServiceEntry::CreateOfferServiceEntry |
( |
uint16_t |
serviceId, |
|
|
uint16_t |
instanceId, |
|
|
uint8_t |
majorVersion, |
|
|
uint32_t |
minorVersion, |
|
|
uint32_t |
ttl = cInfiniteTtl |
|
) |
| |
|
static |
Offer a service entry factory.
- Parameters
-
serviceId | Service in interest ID |
instanceId | Service in interest instance ID |
majorVersion | Service in interest major version |
minorVersion | Service in interest minor version |
ttl | Service offering lifetime |
- Returns
- Offer service entry
◆ CreateStopOfferEntry()
std::unique_ptr< ServiceEntry > ara::com::entry::ServiceEntry::CreateStopOfferEntry |
( |
uint16_t |
serviceId, |
|
|
uint16_t |
instanceId, |
|
|
uint8_t |
majorVersion, |
|
|
uint32_t |
minorVersion |
|
) |
| |
|
staticnoexcept |
Stop offer a service entry factory.
- Parameters
-
serviceId | Service in interest ID |
instanceId | Service in interest instance ID |
majorVersion | Service in interest major version |
minorVersion | Service in interest minor version |
- Returns
- Stop service offering entry
◆ Deserialize()
std::unique_ptr< ServiceEntry > ara::com::entry::ServiceEntry::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 a service entry |
◆ MinorVersion()
uint32_t ara::com::entry::ServiceEntry::MinorVersion |
( |
| ) |
const |
|
noexcept |
Get minor version.
- Returns
- Service minor version
◆ Payload()
std::vector< uint8_t > ara::com::entry::ServiceEntry::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::ServiceEntry::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.