Skip to content

Engine → Modules → module_service.h

service_table

Syntax

class CONJURE_API service_table

Constructors

AccessSignatureDescription
publicservice_table();

Important

Copy constructor and assignment has been deleted.

Destructors

AccessSignatureDescription
public~service_table();

Variables

AccessNameTypeDefaultDescription
privatemServicescore::flat_map<service_id, void *>{}

Functions

Public

clear

void clear() noexcept;

Forgets every service.

contains

[[nodiscard]] bool contains(
    service_id id) const noexcept;

True when a service is registered under the id.

find

template <typename ServiceType> [[nodiscard]] ServiceType *find() const noexcept;

The object provided for ServiceType, or nullptr.

provide

template <typename ServiceType> void provide(
    ServiceType &service);

Registers a host object under ServiceType::SERVICE_ID. Providing the same service twice asserts and keeps the first.

size

[[nodiscard]] usize size() const noexcept;

Number of provided services.

Private

find_raw

[[nodiscard]] void *find_raw(
    service_id id) const noexcept;

provide_raw

void provide_raw(
    service_id id,
    void *service,
    std::string_view name);