ADTF
Loading...
Searching...
No Matches
ADTF Service

Description

An ADTF Service provides functionality that is independent from the Streaming Architecture.

This might be clocks, databases (DBC, FIBEX, ARXML, ...), UIs and any other kind of additional functionality that graph objects like a filter or streaming service (source or sink) may require to perform its tasks.
Each ADTF Service will be initialized in a specific adtf::base::tADTFRunLevel.

For an overview please visit the chapter Additional functionality on the mainpage.

A service has to export the adtf::ucom::IService interface.
A basic implementation of this interface is provided by the class adtf::ucom::cService but it is recommended to use or adtf::system::cADTFService.
The adtf::system::cADTFService enriches the adtf::ucom::IService interface with a implementation for adtf::base::IConfiguration.

Note
For UI Services please use adtf::ui::cQtUIService of the package ADTF Qt5.

Concurrent Calls during Graph Initialization

Filters and streaming services without main thread affinity (see adtf::streaming::set_main_thread_affinity) initialize on worker threads, concurrently with each other: Init(StageFirst) and Init(StageNormal) of filters, Construct() of streaming sources and sinks and the matching shutdown calls.
All filters of ADTF itself and the example filters opt out of the main thread affinity.
So a service's interfaces can be called by several threads at once while the filter graph changes its state.
Calls made while the graph runs already come from runner threads, so this mainly concerns interfaces that used to be called only on the main thread, e.g. for registering listeners, event sinks or handlers.

A service must therefore accept concurrent calls to the interfaces that graph objects use during their initialization, or document that components calling them need main thread affinity.

Note
If a service turns out not to be thread safe, set the ADTF_DISABLE_CONCURRENT_INITIALIZATION environment variable to initialize all graph objects on the main thread, see adtf::streaming::cFilterGraph::SetConcurrentInitialization.