Networking TS

PrevUpHomeNext

system_context::add_service

Inherited from execution_context.

(Deprecated: Use make_service().) Add a service object to the execution_context.

template<
    typename Service>
friend void add_service(
    execution_context & e,
    Service * svc);

This function is used to add a service to the execution_context.

Parameters

e

The execution_context object that owns the service.

svc

The service object. On success, ownership of the service object is transferred to the execution_context. When the execution_context object is destroyed, it will destroy the service object by performing:

delete static_cast<execution_context::service*>(svc)

Exceptions

std::experimental::net::v1::service_already_exists

Thrown if a service of the given type is already present in the execution_context.

std::experimental::net::v1::invalid_service_owner

Thrown if the service's owning execution_context is not the execution_context object specified by the e parameter.


PrevUpHomeNext