ADTF  3.14.2
Setup dependencies between components
Required and provided functionality
On the one hand services can publish interfaces to make certain funtionality available for other components. These interfaces have to define a unique interface id (IID). On the other hand services may want to build on this funtionality. To do so they request an instance of an object that implements the desired functionality.
Automation
In order to let ADTF automatically find out which services need to be loaded for a given configuration, the used components must enumerate their dependecies with a special macro. To show that a component offers an implementation for a particular interface use this macro:
#define PROVIDE_INTERFACE(_interface)
Macro usable with ADTF_CLASS_DEPENDENCIES() to provide interfaces by defining class.
#define ADTF_CLASS_DEPENDENCIES(...)
Add interface ids (string literals,.
If a component wants to make use of functionality provided by others use this macro:
#define REQUIRE_INTERFACE(_interface)
Macro usable with ADTF_CLASS_DEPENDENCIES() to require mandatory interfaces.
If a component provides an interface as well as requires an interface the macro can be combined like this:
Why should I follow this procedure?
Using this macro enables the ADTF Plugin Description Generator to create more intelligent plugindescription files, containing provided and required interfaces. As a consequence the Configuration Editor is able to manage the required services and plugins automatically and produce adequate adtfsystem files.
Example
class cPlaybackService: public object<cPlaybackEventService,IPlaybackService>
{
public:
ADTF_CLASS_ID_NAME(cPlaybackService, "playback.service.adtf.cid", "ADTF Player");
PROVIDE_INTERFACE(IPlaybackService)
...
};
#define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel)
Common macro to enable correct treatment of class identifier AND Class Name by IClassInfo.
Definition: class_id.h:33
Processed by the ADTF Plugin Description Generator the created Plugin Description file looks like this:
<plugindescription>
...
<service_descriptions>
<service_description>
<name>playback.service.adtf.cid</name>
<label>ADTF Player</label>
<versions>
...
</versions>
<provided_interfaces>
<interface_description>
<iid>playback_service.services.adtf.iid</iid>
</interface_description>
<interface_description>
<iid>player.ant.services.adtf.iid</iid>
</interface_description>
<interface_description>
<iid>player.bat.services.adtf.iid</iid>
</interface_description>
</provided_interfaces>
<required_interfaces>
<interface_description>
<iid>reference_clock.ant.streaming.adtf.iid</iid>
</interface_description>
<interface_description>
<iid>kernel.ant.services.adtf.iid</iid>
</interface_description>
</required_interfaces>
<required_optional_interfaces/>
<description></description>
...
<service_description>
<service_descriptions>
</plugindescription>

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Tue May 10 2022 by doxygen 1.9.1)