ADTF
graph_object.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "stream_type_helper.h"
9 
10 #include <adtfbase/configuration.h>
29 
30 #include <memory>
31 #include <functional>
32 #include <numeric>
33 
34 namespace adtf
35 {
36 namespace filter
37 {
38 namespace flash
39 {
40 
43 
45 template <typename DATA_TYPE>
47 
50 
52 template<tTimeStamp TIME_RANGE, bool STORELASTSAMPLE = true>
54 
56 template<size_t MAX_SIZE, bool STORELASTSAMPLE = true>
58 
65 template <typename Interface>
67 {
68  public:
70  interface_client() = default;
71 
77  m_pClient(pClient)
78  {}
79 
80  interface_client(const interface_client&) = default;
82  interface_client& operator=(const interface_client&) = default;
83  interface_client& operator=(interface_client&&) = default;
84 
88  bool IsValid()
89  {
90  if (m_pInterface)
91  {
92  return true;
93  }
94 
95  if (!m_pClient ||
96  IS_FAILED(m_pClient->GetServerObject(m_pInterface)))
97  {
98  return false;
99  }
100  m_pClient.Reset();
101  return true;
102  }
103 
107  Interface& Get() const
108  {
109  if (m_pInterface)
110  {
111  return *m_pInterface;
112  }
113 
114  if (!m_pClient)
115  {
116  THROW_ERROR_DESC(ERR_NOT_INITIALIZED, "interface client has not been created");
117  }
118 
119  auto nResult = m_pClient->GetServerObject(m_pInterface);
120  if (IS_FAILED(nResult))
121  {
122  std::string strName;
123  m_pClient->GetName(adtf_string_intf(strName));
124  THROW_IF_FAILED_DESC(nResult,
125  "Unable to aquire server object for client '%s' with interface '%s'.",
126  strName.c_str(),
127  adtf::ucom::get_iid<Interface>());
128  }
129 
130  m_pClient.Reset();
131  return *m_pInterface;
132  }
133 
134  Interface* operator->() const
135  {
136  return &Get();
137  }
138 
139  private:
141  mutable ucom::ant::object_ptr<Interface> m_pInterface;
142 
143 };
144 
184 {
185  public:
186 
192  {
193  public:
194  virtual ~cTriggerHint() = default;
195  };
196 
201  {
202  };
203 
208  {
209  public:
215  cThreadTriggerHint(bool bCyclic = true):
216  m_bCyclic(bCyclic)
217  {
218  }
219 
223  bool GetCyclic() const
224  {
225  return m_bCyclic;
226  }
227 
228  private:
229  bool m_bCyclic;
230  };
231 
236  {
237  public:
243  m_tmInterval(tmInterval)
244  {
245  }
246 
252  m_tmInterval(base::flash::duration_cast<base::flash::tNanoSeconds>(tmInterval))
253  {
254  }
255 
260  {
261  return m_tmInterval;
262  }
263 
264  private:
265  base::flash::tNanoSeconds m_tmInterval;
266  };
267 
272  {
273  public:
278  cDataTriggerHint(const char* strInputName):
279  m_strInputName(strInputName)
280  {
281  }
282 
287  cDataTriggerHint(const std::vector<std::string>& lstInputNames):
288  m_strInputName(std::accumulate(lstInputNames.begin(),
289  lstInputNames.end(),
290  std::string{},
291  [](const auto& strPrevious, const auto& strNext) { return strPrevious.empty() ? strNext : strPrevious + ";" + strNext; }))
292  {
293  }
294 
298  const char* GetInputName() const
299  {
300  return m_strInputName.c_str();
301  }
302 
303  private:
304  std::string m_strInputName;
305  };
306 
307  public:
310 
312  ~cGraphObject() override;
313 
314  public:
335  streaming::ant::IRunner* pRunner);
336 
377 
413 
443  base::flash::tNanoSeconds tmSample,
444  const void* pSampleData,
445  size_t nSampleDataSize);
446 
460  template <typename ReaderType = cPinReader>
461  ReaderType* CreateInputPin(const char* strName,
462  bool bDataInTrigger = true,
463  bool bForwardTriggerViaOutputPins = true);
464 
479  template <typename ReaderType = cPinReader>
480  ReaderType* CreateInputPin(const char* strName,
481  const cStreamTypeHelper& oType,
482  bool bDataInTrigger = true,
483  bool bForwardTriggerViaOutputPins = true);
484 
506  template <typename ReaderType = cPinReader>
507  ReaderType* CreateInputPinWithCallback(const char* strName,
508  const cStreamTypeHelper& oType,
509  std::function<tResult(base::flash::tNanoSeconds)> fnTriggerCallback,
510  bool bForwardTriggerViaOutputPins = true);
511 
534  template <typename ReaderType = cPinReader>
535  ReaderType* CreateInputPinWithCallback(const char* strName,
536  const cStreamTypeHelper& oType,
537  std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)> fnSampleCallback,
538  bool bForwardTriggerViaOutputPins = true);
539 
562  template <typename ReaderType = cPinReader>
563  ReaderType* CreateInputPinWithCallback(const char* strName,
564  const cStreamTypeHelper& oType,
565  std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)> fnSampleDataCallback,
566  bool bForwardTriggerViaOutputPins = true);
567 
591  template <typename Type, typename ReaderType = cPinReader>
592  ReaderType* CreateInputPinWithCallback(const char* strName,
593  const cStreamTypeHelper& oType,
594  std::function<tResult(base::flash::tNanoSeconds, const Type&)> fnDataCallback,
595  bool bForwardTriggerViaOutputPins = true);
596 
625  template <typename WriterType = cPinWriter>
626  WriterType* CreateOutputPin(const char* strName);
627 
640  template <typename WriterType = cPinWriter>
641  WriterType* CreateOutputPin(const char* strName, const cStreamTypeHelper& oType);
642 
659  streaming::ant::IRunner* CreateRunner(const char* strName,
660  const cTriggerHint& oTriggerHint = cNoTriggerHint(),
661  bool bForwardTriggerViaOutputPins = true);
662 
683  streaming::ant::IRunner* CreateRunner(const char* strName,
684  std::function<tResult(base::flash::tNanoSeconds)> fnRunFunction,
685  const cTriggerHint& oTriggerHint = cNoTriggerHint(),
686  bool bForwardTriggerViaOutputPins = true);
687 
706  template <typename Interface, typename Instance>
707  void CreateInterfaceServer(const char* strName, ucom::ant::enable_object_ptr_from_this<Instance>* pInstance);
708 
720  template <typename Interface>
721  void CreateInterfaceServer(const char* strName, const ucom::ant::iobject_ptr<Interface>& pInstance);
722 
734  template <typename Interface>
736 
749  template <typename ReaderType = cPinReader>
750  std::shared_ptr<ReaderType> CreateReader(const char* strName,
751  const cStreamTypeHelper& oType);
752 
765  template <typename WriterType = cPinWriter>
766  std::shared_ptr<WriterType> CreateWriter(const char* strName,
767  const cStreamTypeHelper& oType);
768 
769  using cRuntimeBehaviour::RegisterRunner;
770 
782 
788 
793  tResult RegisterRunner(const char* strName, base::flash::IRunnable& oRunnable);
794 
799  tResult RegisterRunner(const char* strName, adtf::base::ant::IRunnable& oRunnable) override;
800 
805  tResult ConfigureDataInTrigger(const char* strRunnerName, const char* strPinName);
806 
811  tResult ConfigureDataOutTrigger(const char* strRunnerName, const char* strPinName);
812 
817  tResult ConfigureTimerTrigger(const char* strRunnerName, tTimeStamp tmPeriod);
818 
823  tResult ConfigureThreadTrigger(const char* strRunnerName, bool bCallCyclic);
824 
825  public:
838  virtual tResult RequestDynamicInputPin(const char* strName,
840 
853  virtual tResult RequestDynamicOutputPin(const char* strName,
855 
868  virtual tResult RequestDynamicInterfaceClient(const char* strName,
870 
883  virtual tResult RequestDynamicInterfaceServer(const char* strName,
885 
886  public:
888  tResult RequestPin(const char* strName,
891 
893  tResult RequestPin(const char* strName,
896 
898  tResult RequestBindingObject(const char* strName,
901 
903  tResult RequestBindingObject(const char* strName,
906 
907  public:
918  void RegisterPropertyVariable(const char* strName,
919  base::ant::cPropertyVariable& oPropertyVariable);
920 
931  void SetDescription(const char* strDescription);
932 
947  void SetEditor(const char* strName, const char* strUrl);
948 
949  protected:
960  void SetupStreamer(std::shared_ptr<streaming::flash::ISampleStreamer> pStreamer,
961  const char* strName,
963 
968  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
969  bool bDataInTrigger = true,
970  bool bForwardTriggerViaOutputPins = true);
971 
975  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
976  std::function<tResult(base::flash::tNanoSeconds)> fnTriggerCallback,
977  bool bForwardTriggerViaOutputPins = true);
978 
982  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
983  std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)> fnSampleCallback,
984  bool bForwardTriggerViaOutputPins = true);
985 
989  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
990  std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)> fnSampleDataCallback,
991  bool bForwardTriggerViaOutputPins = true);
992 
996  void CreateOutputPin(std::shared_ptr<streaming::flash::ISampleWriter> pWriter);
997 
998  protected:
999 
1009 
1010  protected:
1011  class cImplementation;
1012  std::unique_ptr<cImplementation> m_pImplementation;
1013 };
1014 
1015 template <typename ReaderType>
1016 ReaderType* cGraphObject::CreateInputPin(const char* strName,
1017  bool bDataInTrigger,
1018  bool bForwardTriggerViaOutputPins)
1019 {
1020  return CreateInputPin<ReaderType>(strName,
1022  bDataInTrigger, bForwardTriggerViaOutputPins);
1023 }
1024 
1025 template <typename ReaderType>
1026 ReaderType* cGraphObject::CreateInputPin(const char* strName,
1027  const cStreamTypeHelper& oType,
1028  bool bDataInTrigger,
1029  bool bForwardTriggerViaOutputPins)
1030 {
1031  auto pReader = CreateReader<ReaderType>(strName, oType);
1032  CreateInputPin(pReader, bDataInTrigger, bForwardTriggerViaOutputPins);
1033  return pReader.get();
1034 }
1035 
1036 template <typename ReaderType>
1037 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1038  const cStreamTypeHelper& oType,
1039  std::function<tResult(base::flash::tNanoSeconds)> fnTriggerCallback,
1040  bool bForwardTriggerViaOutputPins)
1041 {
1042  auto pReader = CreateReader<ReaderType>(strName, oType);
1043  CreateInputPin(pReader, fnTriggerCallback, bForwardTriggerViaOutputPins);
1044  return pReader.get();
1045 }
1046 
1047 template <typename ReaderType>
1048 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1049  const cStreamTypeHelper& oType,
1050  std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)> fnSampleCallback,
1051  bool bForwardTriggerViaOutputPins)
1052 {
1053  auto pReader = CreateReader<ReaderType>(strName, oType);
1054  CreateInputPin(pReader, fnSampleCallback, bForwardTriggerViaOutputPins);
1055  return pReader.get();
1056 }
1057 
1058 template<typename ReaderType>
1059 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1060  const cStreamTypeHelper& oType,
1061  std::function<tResult (base::flash::tNanoSeconds, const void*, size_t)> fnSampleDataCallback,
1062  bool bForwardTriggerViaOutputPins)
1063 {
1064  auto pReader = CreateReader<ReaderType>(strName, oType);
1065  CreateInputPin(pReader, fnSampleDataCallback, bForwardTriggerViaOutputPins);
1066  return pReader.get();
1067 }
1068 
1069 
1070 template <typename Type, typename ReaderType>
1071 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1072  const cStreamTypeHelper& oType,
1073  std::function<tResult(base::flash::tNanoSeconds, const Type&)> fnDataCallback,
1074  bool bForwardTriggerViaOutputPins)
1075 {
1076  return CreateInputPinWithCallback<ReaderType>(strName, oType, [fnDataCallback](const ucom::ant::iobject_ptr<const streaming::ant::ISample>& pSample) -> tResult
1077  {
1079  RETURN_IF_FAILED(pSample->Lock(pBuffer));
1080  if (pBuffer->GetSize() < sizeof(Type))
1081  {
1082  RETURN_ERROR_DESC(ERR_INVALID_ARG, "Invalid sample received, its too small for the requested type");
1083  }
1084  return fnDataCallback(streaming::get_sample_time(pSample), *static_cast<const Type*>(pBuffer->GetPtr()));
1085  },
1086  bForwardTriggerViaOutputPins);
1087 }
1088 
1089 template <typename WriterType>
1090 WriterType* cGraphObject::CreateOutputPin(const char* strName)
1091 {
1092  return CreateOutputPin<WriterType>(strName, cStreamTypeHelper(nullptr));
1093 }
1094 
1095 template <typename WriterType>
1096 WriterType* cGraphObject::CreateOutputPin(const char* strName, const cStreamTypeHelper& oType)
1097 {
1098  auto pWriter = CreateWriter<WriterType>(strName, oType);
1099  CreateOutputPin(pWriter);
1100  return pWriter.get();
1101 }
1102 
1103 template <typename Interface, typename Instance>
1105 {
1106  auto pInstancePointer = pInstance->object_ptr_from_this();
1107  if (!pInstancePointer)
1108  {
1109  THROW_ERROR_DESC(ERR_NOT_INITIALIZED, "Unable to add interface server '%s', object_ptr_from_this has not been initialized. "
1110  "This AddInterfaceServer overload cannot be called from within the constructor.",
1111  strName);
1112  }
1113  using namespace adtf::ucom::ant;
1114  using namespace adtf::streaming::ant;
1115  object_ptr<IBindingServer> pBindingServer = make_object_ptr<streaming::elasto::cWeakBindingServer>(strName,
1117  ucom_object_ptr_cast<IObject>(pInstancePointer));
1118  THROW_IF_FAILED(RegisterBindingObject(pBindingServer));
1119 }
1120 
1121 template <typename Interface>
1123 {
1124  using namespace adtf::ucom::ant;
1125  using namespace adtf::streaming::ant;
1126  object_ptr<IBindingServer> pBindingServer = make_object_ptr<cBindingServer>(strName,
1128  ucom_object_ptr_cast<IObject>(pInstance));
1129  THROW_IF_FAILED(RegisterBindingObject(pBindingServer));
1130 }
1131 
1132 template <typename Interface>
1134 {
1136  ucom::ant::make_object_ptr<streaming::ant::cBindingClient>(strName,
1138  THROW_IF_FAILED(RegisterBindingObject(pBindingClient));
1139  return pBindingClient;
1140 }
1141 
1142 template <typename ReaderType>
1143 std::shared_ptr<ReaderType> cGraphObject::CreateReader(const char* strName,
1144  const cStreamTypeHelper& oType)
1145 {
1146  auto pReader = std::make_shared<ReaderType>();
1147  SetupStreamer(pReader, strName, oType.GetStreamType());
1148  pReader->SetAcceptTypeCallback([pReader = pReader.get(), this](const ucom::ant::iobject_ptr<const streaming::ant::IStreamType>& pType) -> tResult
1149  {
1150  return AcceptType(pReader, pType);
1151  });
1152  return pReader;
1153 }
1154 
1155 template <typename WriterType>
1156 std::shared_ptr<WriterType> cGraphObject::CreateWriter(const char* strName,
1157  const cStreamTypeHelper& oType)
1158 {
1159  auto pWriter = std::make_shared<WriterType>();
1160  SetupStreamer(pWriter, strName, oType.GetStreamType());
1161  return pWriter;
1162 }
1163 
1164 }
1165 
1166 namespace hollow
1167 {
1168 
1173 {
1174  public:
1191  template <typename RequestableWriterType = streaming::requestable_writer<>>
1192  RequestableWriterType* CreateRequestableOutputPin(const char* strName,
1194 
1205  uint32_t nSubStreamId,
1206  const base::ant::IProperties* pRequestProperties = nullptr);
1207 
1215  virtual void DisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
1216 
1226  void SetHelpLink(const char* strUrl);
1227 
1236  void SetDescription(const char* strItem, const char* strDescription);
1238 
1239  private:
1240  void LockedCallEnableSubStream(streaming::flash::ISampleWriter* pWriter,
1241  uint32_t nSubStreamId,
1242  const base::ant::IProperties* pRequestProperties);
1243  void LockedCallDisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
1244 };
1245 
1246 template <typename RequestableWriterType>
1247 RequestableWriterType* cGraphObject::CreateRequestableOutputPin(const char* strName, const cStreamTypeHelper& oType)
1248 {
1249  auto pWriter = CreateWriter<RequestableWriterType>(strName, oType);
1251  pWriter->SetCallbacks(std::bind(&cGraphObject::LockedCallEnableSubStream, this, pWriter.get(), std::placeholders::_1, std::placeholders::_2),
1252  std::bind(&cGraphObject::LockedCallDisableSubStream, this, pWriter.get(), std::placeholders::_1));
1253  return pWriter.get();
1254 }
1255 
1256 }
1257 
1258 using flash::cPinReader;
1259 using flash::cPinWriter;
1260 using flash::pin_writer;
1264 
1265 } //namespace filter
1266 } //namespace adtf
1267 
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
Defintion of a property set container interface.
The Runnable interface defines common methods for a running component.
Definition: runnable_intf.h:26
Default implemementation of a property_variable.
Definition: configuration.h:68
Implements all functionality required by ant::IConfiguration.
Hint that a Data-In trigger should be created to trigger a Runner.
Definition: graph_object.h:272
cDataTriggerHint(const std::vector< std::string > &lstInputNames)
Create a new hint with a list of inputs.
Definition: graph_object.h:287
cDataTriggerHint(const char *strInputName)
Create a new hint.
Definition: graph_object.h:278
No hint on which Active Runner to use.
Definition: graph_object.h:201
Hint that a thread Active Runner should be used to trigger a Runner.
Definition: graph_object.h:208
cThreadTriggerHint(bool bCyclic=true)
Constructor that initializes the hint with the information if the thread runner should be cyclic or n...
Definition: graph_object.h:215
Hint that a timer Active Runner should be used to trigger a Runner.
Definition: graph_object.h:236
cTimerTriggerHint(tTimeStamp tmInterval)
Constructor that initializes the hint with the prefered timer interval.
Definition: graph_object.h:251
base::flash::tNanoSeconds GetInterval() const
Definition: graph_object.h:259
cTimerTriggerHint(base::flash::tNanoSeconds tmInterval)
Constructor that initializes the hint with the prefered timer interval.
Definition: graph_object.h:242
Base class for hints that give information on which Active Runner should be connected to a newly crea...
Definition: graph_object.h:192
Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::fi...
Definition: graph_object.h:184
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, base::flash::tNanoSeconds tmSample, const void *pSampleData, size_t nSampleDataSize)
Provides access to the sample content of incoming data.
void SetDescription(const char *strDescription)
Sets the description information that tools can display.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(base::flash::tNanoSeconds, const void *, size_t)> fnSampleDataCallback, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResul...
ucom::ant::object_ptr< services::ant::IReferenceClock > _clock
A reference to the clock service.
ReaderType * CreateInputPin(const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
Creates a new input pin with an anonymous stream type.
~cGraphObject() override
Destructor.
tResult RegisterRunner(const ucom::ant::iobject_ptr< streaming::ant::IRunner > &pRunner) override
This is here for compatibility reasons.
tResult RequestPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType, ucom::ant::iobject_ptr< streaming::ant::IInPin > &pInPin)
For internal use. This will call RequestDynamicInputPin().
streaming::ant::IRunner * CreateRunner(const char *strName, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
Creates a new Runner that can be triggered by an Active Runner.
tResult ConfigureThreadTrigger(const char *strRunnerName, bool bCallCyclic)
This is here for compatibility reasons.
tResult ConfigureDataInTrigger(const char *strRunnerName, const char *strPinName)
This is here for compatibility reasons.
tResult RequestPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType, ucom::ant::iobject_ptr< streaming::ant::IOutPin > &pOutPin)
For internal use. This will call RequestDynamicOutputPin().
tResult ConfigureTimerTrigger(const char *strRunnerName, tTimeStamp tmPeriod)
This is here for compatibility reasons.
virtual tResult RequestDynamicInterfaceServer(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
Called whenever a new dynamic interface server binding object is requested.
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, std::function< tResult(base::flash::tNanoSeconds)> fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
Creates a new input pin with a given stream type.
tResult RegisterRunner(const char *strName, base::flash::IRunnable &oRunnable)
This is here for compatibility reasons.
WriterType * CreateOutputPin(const char *strName)
Creates a new output pin without an initial stream type.
void CreateInterfaceServer(const char *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
Creates an interface server binding object.
streaming::ant::IRunner * CreateRunner(const char *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunFunction, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
Creates a new Runner that can be triggered by an Active Runner.
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::ISample > &pSample)
Provides access to the sample of incoming data.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(base::flash::tNanoSeconds)> fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResul...
virtual tResult AcceptType(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Called whenever a new type is read from a reader that has no other accept type callback (streaming::a...
tResult RequestBindingObject(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType, ucom::ant::iobject_ptr< streaming::ant::IBindingClient > &pClient)
For internal use. This will call RequestDynamicInterfaceClient().
void SetupStreamer(std::shared_ptr< streaming::flash::ISampleStreamer > pStreamer, const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Used by the templated CreateInputPin() and CreateOutputPin() methods.
std::shared_ptr< WriterType > CreateWriter(const char *strName, const cStreamTypeHelper &oType)
Creates and intializes a new sample reader.
virtual tResult Process(base::flash::tNanoSeconds tmTrigger, streaming::ant::IRunner *pRunner)
The default Runner function of the graph object.
tResult RegisterRunner(const char *strName, adtf::base::ant::IRunnable &oRunnable) override
This is here for compatibility reasons.
virtual tResult RequestDynamicOutputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Called whenever a new dynamic output pin is requested.
virtual tResult RequestDynamicInterfaceClient(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
Called whenever a new dynamic interface client binding object is requested.
interface_client< Interface > CreateInterfaceClient(const char *strName)
Creates an interface client binding object.
void CreateOutputPin(std::shared_ptr< streaming::flash::ISampleWriter > pWriter)
The implementation used by CreateOutputPin(const char*, const cStreamTypeHelper&),...
void RegisterPropertyVariable(const char *strName, base::ant::cPropertyVariable &oPropertyVariable)
Registers a new property variable which will always reflect the value of a property.
std::shared_ptr< ReaderType > CreateReader(const char *strName, const cStreamTypeHelper &oType)
Creates and intializes a new sample reader.
ucom::ant::object_ptr< streaming::ant::IRunner > RegisterRunner(const char *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunMethod)
Creates and registers a new Runner.
tResult ConfigureDataOutTrigger(const char *strRunnerName, const char *strPinName)
This is here for compatibility reasons.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::ISample > &)> fnSampleCallback, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResul...
cGraphObject()
Default Constructor.
void SetEditor(const char *strName, const char *strUrl)
Sets the editor information that tools can use to edit the objects properties, pins etc.
virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
Provides access to the reader of incoming data.
tResult RequestBindingObject(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType, ucom::ant::iobject_ptr< streaming::ant::IBindingServer > &pServer)
For internal use. This will call RequestDynamicInterfaceServer().
virtual tResult RequestDynamicInputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Called whenever a new dynamic input pin is requested.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, bool, bool) and CreateInputPin(const char*,...
Helper class that wraps different objects into an adtf::streaming::ant::IStreamType.
ucom::ant::object_ptr< const streaming::ant::IStreamType > GetStreamType() const
Helper class that wraps a streaming::ant::IBindingClient.
Definition: graph_object.h:67
interface_client(const ucom::ant::iobject_ptr< streaming::ant::IBindingClient > &pClient)
/// initializes the object with an existing binding client.
Definition: graph_object.h:76
interface_client()=default
default constructor that initializes the object to an invalid state.
Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::fi...
void SetHelpLink(const char *strUrl)
Sets the link to the documentation that tools can display.
void SetDescription(const char *strItem, const char *strDescription)
Set the description for a data Pin, an Interface Binding Object or a Runner.
virtual void DisableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId)
Called when the last consumer cancels its request for the transmission of samples of a given Substrea...
virtual tResult EnableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr)
This is called when the first consumer requests the transmission of samples of a given Substream.
The Interface defines a runnable item of the GraphObjects providing a IRuntimeBehaviour.
Definition: runner_intf.h:24
Binding type generation template to initialize a BindingType with the information of the INTERFACE ty...
The cFilter class implements a basic filter that supports the IFilter and IPinEventSink interfaces.
Definition: data_binding.h:25
Default IInterfaceBinding implementation.
virtual tResult RegisterBindingObject(const ucom::ant::iobject_ptr< IBindingObject > &pBindingObject)
RegisterBindingObject will register the given pBindingObject within the internal registry.
Default implementation for the IRuntimeBehaviour.
Interface for sample reads that read from sample streams via input pins.
Interface for sample writers that write to sample streams via output pins.
This base implementation of a sample writer is samples and types to the given pin set at adtf::stream...
Definition: samplewriter.h:356
Reads and stores Samples within the given queue implementation INTERNAL_QUEUE.
Specialized Sample Writer to write data of a given type DATA_TYPE (see Supported types for adtf_memor...
Definition: samplewriter.h:490
Safely retrieve a valid object_ptr<> instance to *this when all we have is *this.
object_ptr< T > object_ptr_from_this()
Retrieve an object_ptr with *this being the shared resource.
Base object pointer to realize binary compatible reference counting in interface methods.
Implementation for a shared lock guard.
Object pointer implementation used for reference counting on objects of type IObject.
Definition: object_ptr.h:163
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
DestinationTimeStamp duration_cast(const SourceTimeStamp &)
Duration cast base template to converted between different time resolution.
adtf::streaming::flash::sample_writer< DATA_TYPE > pin_writer
Specialized Sample Writer to write DATA of type DATA_TYPE.
Definition: graph_object.h:46
adtf::streaming::flash::time_limited_sample_reader< TIME_RANGE, STORELASTSAMPLE > time_limited_pin_reader
The time_limited_sample_reader will create a sample reader which will create a internal sample queue ...
Definition: graph_object.h:53
adtf::streaming::flash::size_limited_sample_reader< MAX_SIZE, STORELASTSAMPLE > size_limited_pin_reader
The size_limited_sample_reader will create a sample reader which will create a internal sample queue ...
Definition: graph_object.h:57
adtf::streaming::flash::cDynamicSampleReader cPinReader
use cSampleReader as cPinReader
Definition: graph_object.h:49
adtf::streaming::flash::cSampleWriter cPinWriter
use cSampleWriter as cPinWriter
Definition: graph_object.h:42
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
sample_reader< ant::cDynamicSampleReaderQueue > cDynamicSampleReader
The cDynamicSampleReader will create a sample reader which will create a internal sample queue with u...
base::flash::tNanoSeconds get_sample_time(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
Returns the sample time stamp with nanosecond precision.
Namespace for all functionality provided since v3.0.
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 entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
#define adtf_string_intf(__string__)
The adtf_string_intf Macro helps to easily create a rvalue reference of a adtf::util::cString.
Definition: string_intf.h:371
Use this Stream Meta Type only if no property should be set and you do not share and record these dat...
Copyright © Audi Electronics Venture GmbH.
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception
#define THROW_IF_FAILED_DESC(s,...)
throws if the expression returns a failed tResult and ammends the error message.
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult