ADTF  3.18.2
Source Code for Demo Interface Printer Plugin
Location
./src/examples/src/adtf/streaming_services/sources/demo_interface/
Namespace for entire ADTF SDK.
Build Environment
To see how to set up the build environment have a look at ADTF CMake Environment
this implementation shows:
Header
#pragma once
using namespace adtf::ucom;
using namespace adtf::filter;
class IPrintInterface : public IObject
{
public:
ADTF_IID(IPrintInterface, "demo_print_interface.demo.adtf.iid");
public:
virtual void Print(const char* strString) = 0;
};
class cPrinter : public adtf::ucom::catwo::object<IPrintInterface>
{
public:
virtual void Print(const char* strString);
};
class cInterfaceSource : public cSampleStreamingSource
{
private:
object_ptr<IPrintInterface> m_pPrinter;
public:
ADTF_CLASS_ID_NAME(cInterfaceSource,
"demo_interface_printer.streaming_source.adtf.cid",
"Demo Interface Printer");
public:
cInterfaceSource();
};
#define ADTF_IID(_interface, _striid)
Common macro to enable correct treatment of interface classes by the adtf::ucom::ucom_cast<>
Definition: adtf_iid.h:17
Copyright © Audi Electronics Venture GmbH.
#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
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition: object.h:379
Namespace for the ADTF Filter SDK.
Namespace for the ADTF uCOM3 SDK.
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
Definition: object_intf.h:102
Implementation
#include "demo_interface_source.h"
ADTF_PLUGIN("Demo Interface Printer",
cInterfaceSource);
void cPrinter::Print(const char* strString)
{
LOG_INFO("%s", strString);
}
cInterfaceSource::cInterfaceSource()
{
m_pPrinter = make_object_ptr<cPrinter>();
CreateInterfaceServer<IPrintInterface>("printer_server", m_pPrinter);
SetDescription("printer_server", "Interface server to provide access to function for printing");
// sets a short description for the component
SetDescription("Use this Streaming Source to provide a server for a printer Interface (e.g. used by 'Demo Interface Binding', see Filters");
// set help link to jump to documentation from ADTF Configuration Editor
SetHelpLink("$(ADTF_DIR)/doc/adtf_html/page_demo_interface_printer.html");
}
#define ADTF_PLUGIN(__plugin_identifier,...)
The ADTF Plugin Macro will add the code of a adtf::ucom::ant::IPlugin implementation.
Definition: adtf_plugin.h:22