ADTF  3.18.2
streaming_sink.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "runtime_behaviour.h"
9 #include "streaming_source.h"
10 #include "streaming_sink_intf.h"
11 #include "data_binding.h"
12 #include "named_graph_object.h"
13 #include "interface_binding.h"
15 
16 namespace adtf
17 {
18 namespace streaming
19 {
20 namespace ant
21 {
46  public cRuntimeBehaviour,
48  public ucom::catwo::object<ucom::ant::cClassInfo,
49  base::ant::configuration<>,
50  IDynamicDataBinding,
51  IStreamingService,
52  IStreamingSink,
53  data_binding<named_graph_object<ISampleStreamingSink>>>
54 {
55 
56 private:
59 
60 public:
67  cSampleStreamingSink(const char* strName);
70 
71 public:
72  tResult SetState(tStreamingState eState) override;
73  IStreamingSink::tStreamingState GetState() override;
74 
75  tResult RequestPin(const char* strName,
77  adtf::ucom::ant::iobject_ptr<IInPin>& pInPin) override;
78  tResult RequestPin(const char* strName,
80  adtf::ucom::ant::iobject_ptr<IOutPin>& pOutPin) override;
81 
84 
85 
86 
87  tResult Destruct() override;
88  tResult StartStreaming() override;
89  tResult StopStreaming() override;
90 
91 public:
94 };
95 }
96 
97 namespace catwo
98 {
103  public ucom::catwo::object<ant::cSampleStreamingSink, interface_binding<>>
104  {
105  public:
106  using cInterfaceBinding::RegisterBindingObject;
107  tResult RegisterBindingObject(const ucom::ant::iobject_ptr<IBindingObject>& pBindingObject) override
108  {
109  RETURN_IF_POINTER_NULL(pBindingObject.Get());
110 
111  pBindingObject.Get()->SetParent(static_cast<INamedGraphObject*>(this));
112 
113  return cInterfaceBinding::RegisterBindingObject(pBindingObject);
114  }
115 
116  };
117 
127  template<typename INTERFACE>
129  const char* strServerName,
130  const adtf::ucom::iobject_ptr<INTERFACE>& pServerInterface)
131  {
132  using namespace adtf::ucom;
133  object_ptr<IBindingServer> pBindingServer = make_object_ptr<cBindingServer>(strServerName,
135  ucom_object_ptr_cast<IObject>(pServerInterface));
136  RETURN_IF_FAILED(oStreamingSink.RegisterBindingObject(pBindingServer));
138  }
139 
147  template<typename INTERFACE>
148  tResult create_client(cSampleStreamingSink& oStreamingSink, const char* strClientName)
149  {
150  using namespace adtf::ucom;
151  object_ptr<IBindingClient> pBindingClient = make_object_ptr<cBindingClient>(strClientName,
153  RETURN_IF_FAILED(oStreamingSink.RegisterBindingObject(pBindingClient));
155  }
156 
157 }
158 
159 
160 using catwo::cSampleStreamingSink;
161 
162 }
163 }
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
#define RETURN_IF_POINTER_NULL(_ptr)
Return ERR_POINTER if _ptr is nullptr, which requires the calling function's return type to be tResul...
Interface for a NamedGraphObject which can be added to the FilterGraph.
tStreamingState
States of the Streaming Services.
Binding type generation template to initialize a BindingType with the information of the INTERFACE ty...
virtual tResult RegisterPin(const ucom::ant::iobject_ptr< IPin > &pIPin)
Registers a Pin in a pin list.
Default implementation for the IRuntimeBehaviour.
virtual tResult RegisterRunner(const ucom::ant::iobject_ptr< IRunner > &pRunner)
Registers and publishes a IRunner object to the IRuntimeBehaviour.
virtual tResult RegisterInnerPipe(const ucom::ant::iobject_ptr< ITriggerPipe > &pTriggerPipe)
Registers and publishes an inner ITriggerPipe object to the IRuntimeBehaviour.
Basic implementation for a Streaming Sink.
tResult StopStreaming() override
StopStreaming transission while changing from tStreamingState::State_Streaming to tStreamState::State...
virtual tResult RegisterPin(const ucom::ant::iobject_ptr< IPin > &pIPin)
Registers a Pin in a pin list.
tResult StartStreaming() override
StatrStreaming transission while changing from tStreamState::State_Initialized to tStreamingState::St...
A_UTILS_D(cSampleStreamingSink)
private d_ptr impl.
tResult Destruct() override
Destruct transission while changing from tStreamingState::State_Constructed to tStreamState::State_Sh...
cSampleStreamingSink(const char *strName)
CTOR with name.
The Streaming Service Level Machine implementation.
Basic implementation for a Streaming Sink.
virtual T * Get() const =0
Get raw pointer to shared object.
Base object pointer to realize binary compatible reference counting in interface methods.
Object pointer implementation used for reference counting on objects of type IObject.
Definition: object_ptr.h:163
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition: object.h:379
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
tResult create_server(cSampleStreamingSink &oStreamingSink, const char *strServerName, const adtf::ucom::iobject_ptr< INTERFACE > &pServerInterface)
Creates a binding server object for the given INTERFACE type and register it on the cSampleStreamingS...
tResult create_client(cSampleStreamingSink &oStreamingSink, const char *strClientName)
Creates a binding client object for the given INTERFACE type and register it on the cSampleStreamingS...
std::enable_if< !std::is_base_of< enable_object_ptr_from_this< typename std::remove_cv< Implementation >::type >, typename std::remove_cv< Implementation >::type >::value, object_ptr< Implementation > >::type make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Namespace for the ADTF uCOM3 SDK.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.