ADTF  3.14.3
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 
33 namespace adtf
34 {
35 namespace filter
36 {
37 namespace flash
38 {
39 
42 
44 template <typename DATA_TYPE>
46 
49 
51 template<tTimeStamp TIME_RANGE, bool STORELASTSAMPLE = true>
53 
55 template<size_t MAX_SIZE, bool STORELASTSAMPLE = true>
57 
64 template <typename Interface>
66 {
67  public:
69  interface_client() = default;
70 
76  m_pClient(pClient)
77  {}
78 
79  interface_client(const interface_client&) = default;
81  interface_client& operator=(const interface_client&) = default;
82  interface_client& operator=(interface_client&&) = default;
83 
87  bool IsValid()
88  {
89  if (m_pInterface)
90  {
91  return true;
92  }
93 
94  if (!m_pClient ||
95  IS_FAILED(m_pClient->GetServerObject(m_pInterface)))
96  {
97  return false;
98  }
99  m_pClient.Reset();
100  return true;
101  }
102 
106  Interface& Get() const
107  {
108  if (m_pInterface)
109  {
110  return *m_pInterface;
111  }
112 
113  if (!m_pClient)
114  {
115  THROW_ERROR_DESC(ERR_NOT_INITIALIZED, "interface client has not been created");
116  }
117 
118  auto nResult = m_pClient->GetServerObject(m_pInterface);
119  if (IS_FAILED(nResult))
120  {
121  std::string strName;
122  m_pClient->GetName(adtf_string_intf(strName));
123  THROW_IF_FAILED_DESC(nResult,
124  "Unable to aquire server object for client '%s' with interface '%s'.",
125  strName.c_str(),
126  adtf::ucom::get_iid<Interface>());
127  }
128 
129  m_pClient.Reset();
130  return *m_pInterface;
131  }
132 
133  Interface* operator->() const
134  {
135  return &Get();
136  }
137 
138  private:
140  mutable ucom::ant::object_ptr<Interface> m_pInterface;
141 
142 };
143 
183 {
184  public:
185 
191  {
192  public:
193  virtual ~cTriggerHint() = default;
194  };
195 
200  {
201  };
202 
207  {
208  public:
214  cThreadTriggerHint(bool bCyclic = true):
215  m_bCyclic(bCyclic)
216  {
217  }
218 
222  bool GetCyclic() const
223  {
224  return m_bCyclic;
225  }
226 
227  private:
228  bool m_bCyclic;
229  };
230 
235  {
236  public:
242  m_tmInterval(tmInterval)
243  {
244  }
245 
250  cTimerTriggerHint(tTimeStamp tmInterval):
251  m_tmInterval(base::flash::duration_cast<base::flash::tNanoSeconds>(tmInterval))
252  {
253  }
254 
259  {
260  return m_tmInterval;
261  }
262 
263  private:
264  base::flash::tNanoSeconds m_tmInterval;
265  };
266 
271  {
272  public:
277  cDataTriggerHint(const char* strInputName):
278  m_strInputName(strInputName)
279  {
280  }
281 
285  const char* GetInputName() const
286  {
287  return m_strInputName.c_str();
288  }
289 
290  private:
291  std::string m_strInputName;
292  };
293 
294  public:
297 
299  ~cGraphObject() override;
300 
301  public:
322  virtual tResult Process(base::flash::tNanoSeconds tmTrigger,
323  streaming::ant::IRunner* pRunner);
324 
359  virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger,
361 
387 
407  base::flash::tNanoSeconds tmSample,
408  const void* pSampleData,
409  size_t nSampleDataSize);
410 
424  template <typename ReaderType = cPinReader>
425  ReaderType* CreateInputPin(const char* strName,
426  bool bDataInTrigger = true,
427  bool bForwardTriggerViaOutputPins = true);
428 
443  template <typename ReaderType = cPinReader>
444  ReaderType* CreateInputPin(const char* strName,
445  const cStreamTypeHelper& oType,
446  bool bDataInTrigger = true,
447  bool bForwardTriggerViaOutputPins = true);
448 
466  template <typename ReaderType = cPinReader>
467  ReaderType* CreateInputPinWithCallback(const char* strName,
468  const cStreamTypeHelper& oType,
469  std::function<tResult(base::flash::tNanoSeconds)> fnTriggerCallback,
470  bool bForwardTriggerViaOutputPins = true);
471 
490  template <typename ReaderType = cPinReader>
491  ReaderType* CreateInputPinWithCallback(const char* strName,
492  const cStreamTypeHelper& oType,
493  std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)> fnSampleCallback,
494  bool bForwardTriggerViaOutputPins = true);
495 
514  template <typename ReaderType = cPinReader>
515  ReaderType* CreateInputPinWithCallback(const char* strName,
516  const cStreamTypeHelper& oType,
517  std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)> fnSampleDataCallback,
518  bool bForwardTriggerViaOutputPins = true);
519 
539  template <typename Type, typename ReaderType = cPinReader>
540  ReaderType* CreateInputPinWithCallback(const char* strName,
541  const cStreamTypeHelper& oType,
542  std::function<tResult(base::flash::tNanoSeconds, const Type&)> fnDataCallback,
543  bool bForwardTriggerViaOutputPins = true);
544 
558  virtual tResult AcceptType(streaming::flash::ISampleReader* pReader,
571  template <typename WriterType = cPinWriter>
572  WriterType* CreateOutputPin(const char* strName);
573 
586  template <typename WriterType = cPinWriter>
587  WriterType* CreateOutputPin(const char* strName, const cStreamTypeHelper& oType);
588 
605  streaming::ant::IRunner* CreateRunner(const char* strName,
606  const cTriggerHint& oTriggerHint = cNoTriggerHint(),
607  bool bForwardTriggerViaOutputPins = true);
608 
627  streaming::ant::IRunner* CreateRunner(const char* strName,
628  std::function<tResult(base::flash::tNanoSeconds)> fnRunFunction,
629  const cTriggerHint& oTriggerHint = cNoTriggerHint(),
630  bool bForwardTriggerViaOutputPins = true);
631 
650  template <typename Interface, typename Instance>
651  void CreateInterfaceServer(const char* strName, ucom::ant::enable_object_ptr_from_this<Instance>* pInstance);
652 
664  template <typename Interface>
665  void CreateInterfaceServer(const char* strName, const ucom::ant::iobject_ptr<Interface>& pInstance);
666 
678  template <typename Interface>
680 
693  template <typename ReaderType = cPinReader>
694  std::shared_ptr<ReaderType> CreateReader(const char* strName,
695  const cStreamTypeHelper& oType);
696 
709  template <typename WriterType = cPinWriter>
710  std::shared_ptr<WriterType> CreateWriter(const char* strName,
711  const cStreamTypeHelper& oType);
712 
713  using cRuntimeBehaviour::RegisterRunner;
714 
725  ucom::ant::object_ptr<streaming::ant::IRunner> RegisterRunner(const char* strName, std::function<tResult(base::flash::tNanoSeconds)> fnRunMethod);
726 
732 
737  tResult RegisterRunner(const char* strName, base::flash::IRunnable& oRunnable);
738 
743  tResult RegisterRunner(const char* strName, adtf::base::ant::IRunnable& oRunnable) override;
744 
749  tResult ConfigureDataInTrigger(const char* strRunnerName, const char* strPinName);
750 
755  tResult ConfigureDataOutTrigger(const char* strRunnerName, const char* strPinName);
756 
761  tResult ConfigureTimerTrigger(const char* strRunnerName, tTimeStamp tmPeriod);
762 
767  tResult ConfigureThreadTrigger(const char* strRunnerName, bool bCallCyclic);
768 
769  public:
782  virtual tResult RequestDynamicInputPin(const char* strName,
784 
797  virtual tResult RequestDynamicOutputPin(const char* strName,
799 
812  virtual tResult RequestDynamicInterfaceClient(const char* strName,
814 
827  virtual tResult RequestDynamicInterfaceServer(const char* strName,
829 
830  public:
832  tResult RequestPin(const char* strName,
835 
837  tResult RequestPin(const char* strName,
840 
842  tResult RequestBindingObject(const char* strName,
845 
847  tResult RequestBindingObject(const char* strName,
850 
851  public:
862  void RegisterPropertyVariable(const char* strName,
863  base::ant::cPropertyVariable& oPropertyVariable);
864 
875  void SetDescription(const char* strDescription);
876 
891  void SetEditor(const char* strName, const char* strUrl);
892 
893  protected:
904  void SetupStreamer(std::shared_ptr<streaming::flash::ISampleStreamer> pStreamer,
905  const char* strName,
907 
912  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
913  bool bDataInTrigger = true,
914  bool bForwardTriggerViaOutputPins = true);
915 
919  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
920  std::function<tResult(base::flash::tNanoSeconds)> fnTriggerCallback,
921  bool bForwardTriggerViaOutputPins = true);
922 
926  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
927  std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)> fnSampleCallback,
928  bool bForwardTriggerViaOutputPins = true);
929 
933  void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
934  std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)> fnSampleDataCallback,
935  bool bForwardTriggerViaOutputPins = true);
936 
940  void CreateOutputPin(std::shared_ptr<streaming::flash::ISampleWriter> pWriter);
941 
942  protected:
943 
953 
954  protected:
955  class cImplementation;
956  std::unique_ptr<cImplementation> m_pImplementation;
957 };
958 
959 template <typename ReaderType>
960 ReaderType* cGraphObject::CreateInputPin(const char* strName,
961  bool bDataInTrigger,
962  bool bForwardTriggerViaOutputPins)
963 {
964  return CreateInputPin<ReaderType>(strName,
966  bDataInTrigger, bForwardTriggerViaOutputPins);
967 }
968 
969 template <typename ReaderType>
970 ReaderType* cGraphObject::CreateInputPin(const char* strName,
971  const cStreamTypeHelper& oType,
972  bool bDataInTrigger,
973  bool bForwardTriggerViaOutputPins)
974 {
975  auto pReader = CreateReader<ReaderType>(strName, oType);
976  CreateInputPin(pReader, bDataInTrigger, bForwardTriggerViaOutputPins);
977  return pReader.get();
978 }
979 
980 template <typename ReaderType>
981 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
982  const cStreamTypeHelper& oType,
983  std::function<tResult(base::flash::tNanoSeconds)> fnTriggerCallback,
984  bool bForwardTriggerViaOutputPins)
985 {
986  auto pReader = CreateReader<ReaderType>(strName, oType);
987  CreateInputPin(pReader, fnTriggerCallback, bForwardTriggerViaOutputPins);
988  return pReader.get();
989 }
990 
991 template <typename ReaderType>
992 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
993  const cStreamTypeHelper& oType,
994  std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)> fnSampleCallback,
995  bool bForwardTriggerViaOutputPins)
996 {
997  auto pReader = CreateReader<ReaderType>(strName, oType);
998  CreateInputPin(pReader, fnSampleCallback, bForwardTriggerViaOutputPins);
999  return pReader.get();
1000 }
1001 
1002 template<typename ReaderType>
1003 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1004  const cStreamTypeHelper& oType,
1005  std::function<tResult (base::flash::tNanoSeconds, const void*, size_t)> fnSampleDataCallback,
1006  bool bForwardTriggerViaOutputPins)
1007 {
1008  auto pReader = CreateReader<ReaderType>(strName, oType);
1009  CreateInputPin(pReader, fnSampleDataCallback, bForwardTriggerViaOutputPins);
1010  return pReader.get();
1011 }
1012 
1013 
1014 template <typename Type, typename ReaderType>
1015 ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1016  const cStreamTypeHelper& oType,
1017  std::function<tResult(base::flash::tNanoSeconds, const Type&)> fnDataCallback,
1018  bool bForwardTriggerViaOutputPins)
1019 {
1020  return CreateInputPinWithCallback<ReaderType>(strName, oType, [fnDataCallback](const ucom::ant::iobject_ptr<const streaming::ant::ISample>& pSample) -> tResult
1021  {
1023  RETURN_IF_FAILED(pSample->Lock(pBuffer));
1024  if (pBuffer->GetSize() < sizeof(Type))
1025  {
1026  RETURN_ERROR_DESC(ERR_INVALID_ARG, "Invalid sample received, its too small for the requested type");
1027  }
1028  return fnDataCallback(streaming::get_sample_time(pSample), *static_cast<const Type*>(pBuffer->GetPtr()));
1029  },
1030  bForwardTriggerViaOutputPins);
1031 }
1032 
1033 template <typename WriterType>
1034 WriterType* cGraphObject::CreateOutputPin(const char* strName)
1035 {
1036  return CreateOutputPin<WriterType>(strName, cStreamTypeHelper(nullptr));
1037 }
1038 
1039 template <typename WriterType>
1040 WriterType* cGraphObject::CreateOutputPin(const char* strName, const cStreamTypeHelper& oType)
1041 {
1042  auto pWriter = CreateWriter<WriterType>(strName, oType);
1043  CreateOutputPin(pWriter);
1044  return pWriter.get();
1045 }
1046 
1047 template <typename Interface, typename Instance>
1049 {
1050  auto pInstancePointer = pInstance->object_ptr_from_this();
1051  if (!pInstancePointer)
1052  {
1053  THROW_ERROR_DESC(ERR_NOT_INITIALIZED, "Unable to add interface server '%s', object_ptr_from_this has not been initialized. "
1054  "This AddInterfaceServer overload cannot be called from within the constructor.",
1055  strName);
1056  }
1057  using namespace adtf::ucom::ant;
1058  using namespace adtf::streaming::ant;
1059  object_ptr<IBindingServer> pBindingServer = make_object_ptr<streaming::elasto::cWeakBindingServer>(strName,
1061  ucom_object_ptr_cast<IObject>(pInstancePointer));
1062  THROW_IF_FAILED(RegisterBindingObject(pBindingServer));
1063 }
1064 
1065 template <typename Interface>
1067 {
1068  using namespace adtf::ucom::ant;
1069  using namespace adtf::streaming::ant;
1070  object_ptr<IBindingServer> pBindingServer = make_object_ptr<cBindingServer>(strName,
1072  ucom_object_ptr_cast<IObject>(pInstance));
1073  THROW_IF_FAILED(RegisterBindingObject(pBindingServer));
1074 }
1075 
1076 template <typename Interface>
1078 {
1080  ucom::ant::make_object_ptr<streaming::ant::cBindingClient>(strName,
1082  THROW_IF_FAILED(RegisterBindingObject(pBindingClient));
1083  return pBindingClient;
1084 }
1085 
1086 template <typename ReaderType>
1087 std::shared_ptr<ReaderType> cGraphObject::CreateReader(const char* strName,
1088  const cStreamTypeHelper& oType)
1089 {
1090  auto pReader = std::make_shared<ReaderType>();
1091  SetupStreamer(pReader, strName, oType.GetStreamType());
1092  pReader->SetAcceptTypeCallback([pReader = pReader.get(), this](const ucom::ant::iobject_ptr<const streaming::ant::IStreamType>& pType) -> tResult
1093  {
1094  return AcceptType(pReader, pType);
1095  });
1096  return pReader;
1097 }
1098 
1099 template <typename WriterType>
1100 std::shared_ptr<WriterType> cGraphObject::CreateWriter(const char* strName,
1101  const cStreamTypeHelper& oType)
1102 {
1103  auto pWriter = std::make_shared<WriterType>();
1104  SetupStreamer(pWriter, strName, oType.GetStreamType());
1105  return pWriter;
1106 }
1107 
1108 }
1109 
1110 namespace hollow
1111 {
1112 
1117 {
1118  public:
1135  template <typename RequestableWriterType = streaming::requestable_writer<>>
1136  RequestableWriterType* CreateRequestableOutputPin(const char* strName,
1138 
1149  uint32_t nSubStreamId,
1150  const base::ant::IProperties* pRequestProperties = nullptr);
1151 
1159  virtual void DisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
1160 
1170  void SetHelpLink(const char* strUrl);
1171 
1180  void SetDescription(const char* strItem, const char* strDescription);
1182 
1183  private:
1184  void LockedCallEnableSubStream(streaming::flash::ISampleWriter* pWriter,
1185  uint32_t nSubStreamId,
1186  const base::ant::IProperties* pRequestProperties);
1187  void LockedCallDisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
1188 };
1189 
1190 template <typename RequestableWriterType>
1191 RequestableWriterType* cGraphObject::CreateRequestableOutputPin(const char* strName, const cStreamTypeHelper& oType)
1192 {
1193  auto pWriter = CreateWriter<RequestableWriterType>(strName, oType);
1195  pWriter->SetCallbacks(std::bind(&cGraphObject::LockedCallEnableSubStream, this, pWriter.get(), std::placeholders::_1, std::placeholders::_2),
1196  std::bind(&cGraphObject::LockedCallDisableSubStream, this, pWriter.get(), std::placeholders::_1));
1197  return pWriter.get();
1198 }
1199 
1200 }
1201 
1202 using flash::cPinReader;
1203 using flash::cPinWriter;
1204 using flash::pin_writer;
1208 
1209 } //namespace filter
1210 } //namespace adtf
1211 
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:67
Implements all functionality required by ant::IConfiguration.
Hint that a Data-In trigger should be created to trigger a Runner.
Definition: graph_object.h:271
cDataTriggerHint(const char *strInputName)
Create a new hint.
Definition: graph_object.h:277
No hint on which Active Runner to use.
Definition: graph_object.h:200
Hint that a thread Active Runner should be used to trigger a Runner.
Definition: graph_object.h:207
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:214
Hint that a timer Active Runner should be used to trigger a Runner.
Definition: graph_object.h:235
cTimerTriggerHint(tTimeStamp tmInterval)
Constructor that initializes the hint with the prefered timer interval.
Definition: graph_object.h:250
base::flash::tNanoSeconds GetInterval() const
Definition: graph_object.h:258
cTimerTriggerHint(base::flash::tNanoSeconds tmInterval)
Constructor that initializes the hint with the prefered timer interval.
Definition: graph_object.h:241
Base class for hints that give information on which Active Runner should be connected to a newly crea...
Definition: graph_object.h:191
Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::fi...
Definition: graph_object.h:183
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, base::flash::tNanoSeconds tmSample, const void *pSampleData, size_t nSampleDataSize)
Called by the default implementation of ProcessInput(streaming::flash::ISampleReader*,...
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.
Definition: graph_object.h:952
ReaderType * CreateInputPin(const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
Creates a new input pin with an anonymous stream type.
Definition: graph_object.h:960
~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.
Definition: graph_object.h:981
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)
Called by the default implementation of ProcessInput(base::flash::tNanoSeconds, streaming::flash::ISa...
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)
Default method to process input 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:66
interface_client(const ucom::ant::iobject_ptr< streaming::ant::IBindingClient > &pClient)
/// initializes the object with an existing binding client.
Definition: graph_object.h:75
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:362
Reads and stores Samples within the given queue implementation INTERNAL_QUEUE.
Specialized Sample Writer to write data of a given type DATA_TYPE.
Definition: samplewriter.h:445
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:158
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.
adtf::streaming::flash::sample_writer< DATA_TYPE > pin_writer
Specialized Sample Writer to write DATA of type DATA_TYPE.
Definition: graph_object.h:45
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:52
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:56
adtf::streaming::flash::cDynamicSampleReader cPinReader
use cSampleReader as cPinReader
Definition: graph_object.h:48
adtf::streaming::flash::cSampleWriter cPinWriter
use cSampleWriter as cPinWriter
Definition: graph_object.h:41
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:285
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 RETURN_IF_FAILED(s)
returns if the expression returns a failed tResult or throws an 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

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Thu Jun 9 2022 by doxygen 1.9.1)