Skip to navigation

hololink::module::ServiceBase

View as Markdown

Holds the handle to the Module a service was published with.

A service reaches the other services it cooperates with (for example a data channel finding its device) through this Module, so that they all come from the same module as the service itself.

Services use virtual inheritance of ServiceBase to ensure they have exactly one pointer to the owner Module, even when a service implements several interfaces.

Applications do not use this class directly; it is a base of every interface derived from Service.

#include <hololink/module/service.hpp>

Methods

module

std::shared_ptr<Module> hololink::module::ServiceBase::module() const

The Module that this service was published from.

The service holds no strong reference to its Module, so this does not extend the Module’s lifetime.

Returns: The owning Module, or an empty pointer if the service has not been published or its Module no longer exists.