Exception-less preconstruction of ServiceInterfaceSkeleton.

 

The ServiceInterfaceSkeleton can be preconstructed using:

Syntax

// Preconstruct with InstanceIdentifier
ConstructionResult namespace::ExampleServiceInterfaceSkeleton::Preconstruct (ara::com::InstanceIdentifier instance_id,
ara::com::MethodCallProcessingMode const mode = ara::com::MethodCallProcessingMode::kEvent, std::size_t const max_requests = 0)

// Preconstruct with InstanceSpecifier
ConstructionResult namespace::ExampleServiceInterfaceSkeleton::Preconstruct (ara::core::InstanceSpecifier instance,
ara::com::MethodCallProcessingMode const mode = ara::com::MethodCallProcessingMode::kEvent, std::size_t const max_requests = 0)

// Preconstruct with InstanceIdentifierContainer
ConstructionResult namespace::ExampleServiceInterfaceSkeleton::Preconstruct (ara::com::InstanceIdentifierContainer instance_identifiers,
ara::com::MethodCallProcessingMode const mode = ara::com::MethodCallProcessingMode::kEvent, std::size_t const max_requests = 0)

Parameters

in

instance_id

The InstanceIdentifier of the service instance to be created. Expected format: "<Binding type/prefix>:<binding specific instance ID>".

Preconditions:

  • InstanceIdentifier must be configured.
  • Must belong to the service interface.

in

instance

The InstanceSpecifier of the service instance to be created.

Preconditions:

  • InstanceSpecifier must be configured.

Must belong to the service interface.

in

mode

The mode of the service implementation for processing service method invocations.

Default: Event-driven processing.

Preconditions:

  • If the mode 'kEventSingleThread' is used, a possible user-defined ThreadPool must have exactly one worker thread configured.

in

max_requrests

The maximal number of method requests that can be queued per skeleton instance.

The default is 0: no upper limit for incoming method requests.

Usage hint:

For kEvent/kEventSingleThreaded mode, the sum of values used for all skeleton instances must not exceed the corresponding threadpool’s max_number_of_tasks to avoid memory wastage. If a user-defined Thread Pool is not configured for this skeleton, then the P-Port Default Thread Pool is used which has a max task limit of 1024.

Returns

ConstructionToken

Result containing construction token from which a skeleton object can be constructed.

Errors

Error Message

Reason

ara::com::ComErrc::kGrantEnforcementError

Request is refused by IAM.

ara::com::ComErrc::kCommunicationLinkError

Connection failure with the SomeIpDaemon.

ara::com::ComErrc::kExceedQueueSize

The given max_requests value exceeds the max_number_of_tasks configured for the threadpool.

ara::com::ComErrc::kCommunicationLinkError

Connection failure with the SomeIpDaemon.

ara::com::ComErrc::kExceedQueueSize

The given max_requests value exceeds the max_number_of_tasks configured for the threadpool.

 

Precondition

Thread-safety, Reentrance, Result Delivery