ADTF
Loading...
Searching...
No Matches
graph_object.h
Go to the documentation of this file.
1
7#pragma once
10
30
31#include <memory>
32#include <functional>
33#include <numeric>
34
35namespace adtf
36{
37namespace filter
38{
39
42
44template<typename DATA_TYPE>
46
49
51template<tTimeStamp TIME_RANGE, bool STORELASTSAMPLE = true>
53
55template<size_t MAX_SIZE, bool STORELASTSAMPLE = true>
57
64template<typename Interface>
66{
67public:
69 interface_client() = default;
70
76 {
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 || IS_FAILED(m_pClient->GetServerObject(m_pInterface)))
95 {
96 return false;
97 }
98 m_pClient.Reset();
99 return true;
100 }
101
105 Interface& Get() const
106 {
107 if (m_pInterface)
108 {
109 return *m_pInterface;
110 }
111
112 if (!m_pClient)
113 {
114 THROW_ERROR_DESC(ERR_NOT_INITIALIZED, "interface client has not been created");
115 }
116
117 auto nResult = m_pClient->GetServerObject(m_pInterface);
118 if (IS_FAILED(nResult))
119 {
120 std::string strName;
121 m_pClient->GetName(adtf_string_intf(strName));
122 THROW_IF_FAILED_DESC(nResult, "Unable to aquire server object for client '%s' with interface '%s'.",
123 strName.c_str(), adtf::ucom::get_iid<Interface>());
124 }
125
126 m_pClient.Reset();
127 return *m_pInterface;
128 }
129
130 Interface* operator->() const
131 {
132 return &Get();
133 }
134
135private:
137 mutable ucom::ant::object_ptr<Interface> m_pInterface;
138};
139
174{
175public:
181 {
182 public:
183 virtual ~cTriggerHint() = default;
184 };
185
190 {
191 };
192
197 {
198 public:
204 cThreadTriggerHint(bool bCyclic = true): m_bCyclic(bCyclic)
205 {
206 }
207
211 bool GetCyclic() const
212 {
213 return m_bCyclic;
214 }
215
216 private:
217 bool m_bCyclic;
218 };
219
224 {
225 public:
230 cTimerTriggerHint(base::flash::tNanoSeconds tmInterval): m_tmInterval(tmInterval)
231 {
232 }
233
238 cTimerTriggerHint(tTimeStamp tmInterval):
239 m_tmInterval(base::flash::duration_cast<base::flash::tNanoSeconds>(tmInterval))
240 {
241 }
242
247 {
248 return m_tmInterval;
249 }
250
251 private:
252 base::flash::tNanoSeconds m_tmInterval;
253 };
254
259 {
260 public:
265 cDataTriggerHint(const char* strInputName): m_strInputName(strInputName)
266 {
267 }
268
273 cDataTriggerHint(const std::vector<std::string>& lstInputNames):
274 m_strInputName(std::accumulate(lstInputNames.begin(),
275 lstInputNames.end(),
276 std::string{},
277 [](const auto& strPrevious, const auto& strNext)
278 { return strPrevious.empty() ? strNext : strPrevious + ";" + strNext; }))
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
294public:
297
299 ~cGraphObject() override;
300
301public:
324
370
410
445 const void* pSampleData,
446 size_t nSampleDataSize);
447
463 template<typename ReaderType = cPinReader>
464 ReaderType*
465 CreateInputPin(const char* strName, bool bDataInTrigger = true, bool bForwardTriggerViaOutputPins = true);
466
483 template<typename ReaderType = cPinReader>
484 ReaderType* CreateInputPin(const char* strName,
485 const cStreamTypeHelper& oType,
486 bool bDataInTrigger = true,
487 bool bForwardTriggerViaOutputPins = true);
488
513 template<typename ReaderType = cPinReader,
514 typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds)>,
515 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool> =
516 true>
517 ReaderType* CreateInputPinWithCallback(const char* strName,
518 const cStreamTypeHelper& oType,
519 CALLABLE&& fnTriggerCallback,
520 bool bForwardTriggerViaOutputPins = true);
521
547 template<typename ReaderType = cPinReader,
548 typename CALLABLE = std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)>,
549 std::enable_if_t<std::is_invocable_r_v<tResult,
550 std::decay_t<CALLABLE>,
552 bool> = true>
553 ReaderType* CreateInputPinWithCallback(const char* strName,
554 const cStreamTypeHelper& oType,
555 CALLABLE&& fnSampleCallback,
556 bool bForwardTriggerViaOutputPins = true);
557
583 template<typename ReaderType = cPinReader,
584 typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)>,
585 std::enable_if_t<
586 std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds, const void*, size_t>,
587 bool> = true>
588 ReaderType* CreateInputPinWithCallback(const char* strName,
589 const cStreamTypeHelper& oType,
590 CALLABLE&& fnSampleDataCallback,
591 bool bForwardTriggerViaOutputPins = true);
592
620 template<
621 typename Type,
622 typename ReaderType = cPinReader,
623 typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds, const Type&)>,
624 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds, const Type&>,
625 bool> = true>
626 ReaderType* CreateInputPinWithCallback(const char* strName,
627 const cStreamTypeHelper& oType,
628 CALLABLE&& fnDataCallback,
629 bool bForwardTriggerViaOutputPins = true);
630
659 template<typename WriterType = cPinWriter>
660 WriterType* CreateOutputPin(const char* strName);
661
674 template<typename WriterType = cPinWriter>
675 WriterType* CreateOutputPin(const char* strName, const cStreamTypeHelper& oType);
676
693 template<typename RequestableWriterType = streaming::requestable_writer<>>
694 RequestableWriterType*
695 CreateRequestableOutputPin(const char* strName,
697
716 const cTriggerHint& oTriggerHint = cNoTriggerHint(),
717 bool bForwardTriggerViaOutputPins = true);
718
741 template<typename CALLABLE,
742 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool> =
743 true>
744 streaming::ant::IRunner* CreateRunner(const char* strName,
745 CALLABLE&& fnRunFunction,
746 const cTriggerHint& oTriggerHint = cNoTriggerHint(),
747 bool bForwardTriggerViaOutputPins = true);
748
767 template<typename Interface, typename Instance>
769
781 template<typename Interface>
782 void CreateInterfaceServer(const char* strName, const ucom::ant::iobject_ptr<Interface>& pInstance);
783
795 template<typename Interface>
797
810 template<typename ReaderType = cPinReader>
811 std::shared_ptr<ReaderType> CreateReader(const char* strName, const cStreamTypeHelper& oType);
812
825 template<typename WriterType = cPinWriter>
826 std::shared_ptr<WriterType> CreateWriter(const char* strName, const cStreamTypeHelper& oType);
827
828 using cRuntimeBehaviour::RegisterRunner;
829
840 template<typename CALLABLE,
841 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool> =
842 true>
843 ucom::ant::object_ptr<streaming::ant::IRunner> RegisterRunner(const char* strName, CALLABLE&& fnRunFunction);
844
850
855 tResult RegisterRunner(const char* strName, base::flash::IRunnable& oRunnable);
856
861 tResult RegisterRunner(const char* strName, adtf::base::ant::IRunnable& oRunnable) override;
862
867 tResult ConfigureDataInTrigger(const char* strRunnerName, const char* strPinName);
868
873 tResult ConfigureDataOutTrigger(const char* strRunnerName, const char* strPinName);
874
879 tResult ConfigureTimerTrigger(const char* strRunnerName, tTimeStamp tmPeriod);
880
885 tResult ConfigureThreadTrigger(const char* strRunnerName, bool bCallCyclic);
886
887public:
900 virtual tResult RequestDynamicInputPin(const char* strName,
902
915 virtual tResult RequestDynamicOutputPin(const char* strName,
917
930 virtual tResult
931 RequestDynamicInterfaceClient(const char* strName,
933
946 virtual tResult
947 RequestDynamicInterfaceServer(const char* strName,
949
961 uint32_t nSubStreamId,
962 const base::ant::IProperties* pRequestProperties = nullptr);
963
972 virtual void DisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
973
974public:
976 tResult RequestPin(const char* strName,
979
981 tResult RequestPin(const char* strName,
984
986 tResult RequestBindingObject(const char* strName,
989
991 tResult RequestBindingObject(const char* strName,
994
995public:
1006 void RegisterPropertyVariable(const char* strName, base::ant::cPropertyVariable& oPropertyVariable);
1007
1018 void SetDescription(const char* strDescription);
1019
1028 void SetDescription(const char* strItem, const char* strDescription);
1029
1044 void SetEditor(const char* strName, const char* strUrl);
1045
1055 void SetHelpLink(const char* strUrl);
1056
1058
1059public:
1063 enum class tRecoverableAction : uint8_t
1064 {
1065 Log = 0,
1067 };
1068
1086 util::log::ILogChannel* CreateLogChannel(
1087 std::string_view strName,
1089 tRecoverableAction eDefaultRecoverableAction = tRecoverableAction::Log,
1090 util::log::tLogLevel eDefaultLogLevel = util::log::tLogLevel::Detail);
1091
1103 util::log::ILogChannel* GetLogChannel(std::string_view strName = {});
1104
1109 util::log::ILogChannel* a_util_get_current_log_channel() const noexcept;
1110
1111 tResult SetName(const char* strName);
1112 tResult SetParent(const ucom::ant::IObject* oParentObject);
1113
1114 ucom::object_ptr<services::ant::IMacroResolver> GetParentMacroResolver() const;
1115
1116protected:
1127 void SetupStreamer(std::shared_ptr<streaming::flash::ISampleStreamer> pStreamer,
1128 const char* strName,
1129 const ucom::ant::iobject_ptr<const streaming::ant::IStreamType>& pType);
1130
1135 void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1136 bool bDataInTrigger = true,
1137 bool bForwardTriggerViaOutputPins = true);
1138
1143 template<typename CALLABLE,
1144 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool> =
1145 true>
1146 void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1147 CALLABLE&& fnTriggerCallback,
1148 bool bForwardTriggerViaOutputPins);
1149
1153 void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1154 const char* strTriggerFunctionName,
1155 bool bForwardTriggerViaOutputPins = true);
1156
1161 void CreateOutputPin(std::shared_ptr<streaming::flash::ISampleWriter> pWriter);
1162
1163 void ConfigureRunner(streaming::ant::IRunner* pRunner,
1164 const cTriggerHint& oTriggerHint,
1165 bool bForwardTriggerViaOutputPins);
1166
1167 std::string GetFullName();
1168
1169protected:
1180 ucom::ant::object_ptr<services::ant::IReferenceClock> _clock;
1181
1182protected:
1183 class cImplementation;
1184 std::unique_ptr<cImplementation> m_pImplementation;
1185
1186private:
1187 void LockedCallEnableSubStream(streaming::flash::ISampleWriter* pWriter,
1188 uint32_t nSubStreamId,
1189 const base::ant::IProperties* pRequestProperties);
1190 void LockedCallDisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
1191 std::recursive_mutex& GetProcessMutex();
1192};
1193
1194template<typename CALLABLE,
1195 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1196void cGraphObject::CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1197 CALLABLE&& fnTriggerCallback,
1198 bool bForwardTriggerViaOutputPins)
1199{
1200 std::string strName;
1201 pReader->GetName(base::adtf_string<std::string>(&strName));
1202 const auto strTriggerFunctionName = "process_" + strName;
1203 const auto pRunner = RegisterRunner(
1204 strTriggerFunctionName.c_str(),
1205 [fnTriggerCallback = std::forward<CALLABLE>(fnTriggerCallback), this](base::tNanoSeconds tmTrigger) -> tResult
1206 {
1207 std::lock_guard<std::recursive_mutex> oGuard(GetProcessMutex());
1208 RETURN_IF_FAILED(fnTriggerCallback(tmTrigger));
1209 RETURN_NOERROR;
1210 });
1211 CreateInputPin(pReader, strTriggerFunctionName.c_str(), bForwardTriggerViaOutputPins);
1212}
1213
1214template<typename ReaderType>
1215ReaderType* cGraphObject::CreateInputPin(const char* strName, bool bDataInTrigger, bool bForwardTriggerViaOutputPins)
1216{
1217 return CreateInputPin<ReaderType>(strName, streaming::stream_meta_type_anonymous(), bDataInTrigger,
1218 bForwardTriggerViaOutputPins);
1219}
1220
1221template<typename ReaderType>
1222ReaderType* cGraphObject::CreateInputPin(const char* strName,
1223 const cStreamTypeHelper& oType,
1224 bool bDataInTrigger,
1225 bool bForwardTriggerViaOutputPins)
1226{
1227 auto pReader = CreateReader<ReaderType>(strName, oType);
1228 CreateInputPin(pReader, bDataInTrigger, bForwardTriggerViaOutputPins);
1229 return pReader.get();
1230}
1231
1232template<typename ReaderType,
1233 typename CALLABLE,
1234 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1235ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1236 const cStreamTypeHelper& oType,
1237 CALLABLE&& fnTriggerCallback,
1238 bool bForwardTriggerViaOutputPins)
1239{
1240 auto pReader = CreateReader<ReaderType>(strName, oType);
1241 CreateInputPin(pReader, std::forward<CALLABLE>(fnTriggerCallback), bForwardTriggerViaOutputPins);
1242 return pReader.get();
1243}
1244
1245template<typename ReaderType,
1246 typename CALLABLE,
1247 std::enable_if_t<std::is_invocable_r_v<tResult,
1248 std::decay_t<CALLABLE>,
1250 bool>>
1251ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1252 const cStreamTypeHelper& oType,
1253 CALLABLE&& fnSampleCallback,
1254 bool bForwardTriggerViaOutputPins)
1255{
1256 auto pReader = CreateReader<ReaderType>(strName, oType);
1258 pReader,
1259 [fnSampleCallback = std::forward<CALLABLE>(fnSampleCallback), pReader](base::tNanoSeconds) -> tResult
1260 {
1262 while (IS_OK(pReader->GetNextSample(pSample)))
1263 {
1264 RETURN_IF_FAILED_DESC(fnSampleCallback(pSample),
1265 "Error while processing sample with timestamp = %" PRIi64
1266 "ns, substream id = %" PRIu32 " and buffer size = %zu",
1267 streaming::get_sample_time(pSample).nCount,
1269 [&]() -> size_t
1270 {
1272 if (IS_OK(pSample->Lock(pBuffer)))
1273 {
1274 return pBuffer->GetSize();
1275 }
1276
1277 return 0;
1278 }());
1279 }
1280
1282 },
1283 bForwardTriggerViaOutputPins);
1284 return pReader.get();
1285}
1286
1287template<typename ReaderType,
1288 typename CALLABLE,
1289 std::enable_if_t<
1290 std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds, const void*, size_t>,
1291 bool>>
1292ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1293 const cStreamTypeHelper& oType,
1294 CALLABLE&& fnSampleDataCallback,
1295 bool bForwardTriggerViaOutputPins)
1296{
1298 strName, oType,
1299 [fnSampleDataCallback = std::forward<CALLABLE>(fnSampleDataCallback)](
1301 {
1302 ucom::object_ptr_shared_locked<const streaming::ISampleBuffer> pBuffer;
1303 RETURN_IF_FAILED(pSample->Lock(pBuffer));
1304 return fnSampleDataCallback(streaming::get_sample_time(pSample), pBuffer->GetPtr(), pBuffer->GetSize());
1305 },
1306 bForwardTriggerViaOutputPins);
1307}
1308
1309template<
1310 typename Type,
1311 typename ReaderType,
1312 typename CALLABLE,
1313 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds, const Type&>,
1314 bool>>
1315ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1316 const cStreamTypeHelper& oType,
1317 CALLABLE&& fnDataCallback,
1318 bool bForwardTriggerViaOutputPins)
1319{
1321 strName, oType,
1322 [fnDataCallback = std::forward<CALLABLE>(fnDataCallback)](
1324 {
1325 streaming::sample_data<Type> oSampleData(pSample);
1326 return fnDataCallback(oSampleData.GetTimeNs(), *oSampleData);
1327 },
1328 bForwardTriggerViaOutputPins);
1329}
1330
1331template<typename WriterType>
1332WriterType* cGraphObject::CreateOutputPin(const char* strName)
1333{
1334 return CreateOutputPin<WriterType>(strName, cStreamTypeHelper(nullptr));
1335}
1336
1337template<typename WriterType>
1338WriterType* cGraphObject::CreateOutputPin(const char* strName, const cStreamTypeHelper& oType)
1339{
1340 auto pWriter = CreateWriter<WriterType>(strName, oType);
1341 CreateOutputPin(pWriter);
1342 return pWriter.get();
1343}
1344
1345template<typename Interface, typename Instance>
1348{
1349 auto pInstancePointer = pInstance->object_ptr_from_this();
1350 if (!pInstancePointer)
1351 {
1352 THROW_ERROR_DESC(ERR_NOT_INITIALIZED,
1353 "Unable to add interface server '%s', object_ptr_from_this has not been initialized. "
1354 "This AddInterfaceServer overload cannot be called from within the constructor.",
1355 strName);
1356 }
1357 using namespace adtf::ucom::ant;
1358 using namespace adtf::streaming::ant;
1361 ucom_object_ptr_cast<IObject>(pInstancePointer));
1362 THROW_IF_FAILED(RegisterBindingObject(pBindingServer));
1363}
1364
1365template<typename Interface>
1375
1376template<typename Interface>
1386
1387template<typename ReaderType>
1388std::shared_ptr<ReaderType> cGraphObject::CreateReader(const char* strName, const cStreamTypeHelper& oType)
1389{
1390 auto pReader = std::make_shared<ReaderType>();
1391 SetupStreamer(pReader, strName, oType.GetStreamType());
1392 pReader->SetAcceptTypeCallback(
1393 [pReader = pReader.get(),
1395 {
1396 util::log::cCurrentThreadDefaultLogChannel oLogger(a_util_get_current_log_channel());
1397 return AcceptType(pReader, pType);
1398 });
1399 return pReader;
1400}
1401
1402template<typename WriterType>
1403std::shared_ptr<WriterType> cGraphObject::CreateWriter(const char* strName, const cStreamTypeHelper& oType)
1404{
1405 auto pWriter = std::make_shared<WriterType>();
1406 SetupStreamer(pWriter, strName, oType.GetStreamType());
1407 return pWriter;
1408}
1409
1410template<typename CALLABLE,
1411 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1413 CALLABLE&& fnRunFunction,
1414 const cTriggerHint& oTriggerHint,
1415 bool bForwardTriggerViaOutputPins)
1416{
1417 auto pRunner = RegisterRunner(strName, std::forward<CALLABLE>(fnRunFunction));
1418 ConfigureRunner(pRunner.Get(), oTriggerHint, bForwardTriggerViaOutputPins);
1419 return pRunner.Get();
1420}
1421
1422template<typename CALLABLE,
1423 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1425 CALLABLE&& fnRunFunction)
1426{
1429 strName, GetLogChannel(),
1430 [this, fnRunFunction = std::forward<CALLABLE>(fnRunFunction),
1431 strName = std::string(strName)](base::flash::tNanoSeconds tmTrigger) -> tResult
1432 {
1433 RETURN_IF_FAILED_DESC(fnRunFunction(tmTrigger),
1434 "Error while processing trigger with timestamp %" PRIi64 "ns on %s.%s",
1435 tmTrigger.nCount, GetFullName().c_str(), strName.c_str());
1436
1438 });
1440 return pRunner;
1441}
1442
1443template<typename RequestableWriterType>
1444RequestableWriterType* cGraphObject::CreateRequestableOutputPin(const char* strName, const cStreamTypeHelper& oType)
1445{
1446 auto pWriter = CreateWriter<RequestableWriterType>(strName, oType);
1447 CreateOutputPin(pWriter);
1448 pWriter->SetCallbacks(
1449 std::bind(&cGraphObject::LockedCallEnableSubStream, this, pWriter.get(), std::placeholders::_1,
1450 std::placeholders::_2),
1451 std::bind(&cGraphObject::LockedCallDisableSubStream, this, pWriter.get(), std::placeholders::_1));
1452 return pWriter.get();
1453}
1454
1455} // namespace filter
1456} // namespace adtf
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception
Definition result.h:85
#define IS_FAILED(s)
Check if result is failed.
Definition result.h:20
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define THROW_IF_FAILED_DESC(s,...)
throws if the expression returns a failed tResult and ammends the error message.
Definition result.h:98
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
#define IS_OK(s)
Check if result is OK.
Definition result.h:17
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult
Definition result.h:88
#define RETURN_IF_FAILED_DESC(s,...)
Definition result.h:168
Definition property_intf.h:213
Definition runnable_intf.h:27
Wrapping template for a rvalue reference of an IString interface for the type T.
Definition string_intf.h:281
Definition configuration.h:85
tAction
Definition error_handling_intf.h:32
@ Stop
log error and stop the session.
Definition error_handling_intf.h:35
Definition runnable_intf.h:112
Definition configuration.h:389
cDataTriggerHint(const char *strInputName)
Definition graph_object.h:265
const char * GetInputName() const
Definition graph_object.h:285
cDataTriggerHint(const std::vector< std::string > &lstInputNames)
Definition graph_object.h:273
Definition graph_object.h:190
bool GetCyclic() const
Definition graph_object.h:211
cThreadTriggerHint(bool bCyclic=true)
Definition graph_object.h:204
cTimerTriggerHint(tTimeStamp tmInterval)
Definition graph_object.h:238
base::flash::tNanoSeconds GetInterval() const
Definition graph_object.h:246
cTimerTriggerHint(base::flash::tNanoSeconds tmInterval)
Definition graph_object.h:230
Definition graph_object.h:181
WriterType * CreateOutputPin(const char *strName)
Definition graph_object.h:1332
tResult ActivatePins() override
void SetDescription(const char *strDescription)
tResult RegisterRunner(const ucom::ant::iobject_ptr< streaming::ant::IRunner > &pRunner) override
virtual void DisableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId)
util::log::ILogChannel * a_util_get_current_log_channel() const noexcept
util::log::ILogChannel * CreateLogChannel(std::string_view strName, base::elasto::IErrorHandling::tAction eDefaultErrorAction=base::elasto::IErrorHandling::tAction::Stop, tRecoverableAction eDefaultRecoverableAction=tRecoverableAction::Log, util::log::tLogLevel eDefaultLogLevel=util::log::tLogLevel::Detail)
void SetHelpLink(const char *strUrl)
virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
void SetDescription(const char *strItem, const char *strDescription)
interface_client< Interface > CreateInterfaceClient(const char *strName)
Definition graph_object.h:1377
void RegisterPropertyVariable(const char *strName, base::ant::cPropertyVariable &oPropertyVariable)
~cGraphObject() override
Destructor.
tResult ConfigureThreadTrigger(const char *strRunnerName, bool bCallCyclic)
virtual tResult RequestDynamicOutputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
Definition graph_object.h:1235
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, base::flash::tNanoSeconds tmSample, const void *pSampleData, size_t nSampleDataSize)
std::shared_ptr< WriterType > CreateWriter(const char *strName, const cStreamTypeHelper &oType)
Definition graph_object.h:1403
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 Process(base::flash::tNanoSeconds tmTrigger, streaming::ant::IRunner *pRunner)
virtual tResult EnableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr)
tResult ConfigureTimerTrigger(const char *strRunnerName, tTimeStamp tmPeriod)
tResult RegisterRunner(const char *strName, base::flash::IRunnable &oRunnable)
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnSampleDataCallback, bool bForwardTriggerViaOutputPins=true)
virtual tResult RequestDynamicInterfaceClient(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
virtual tResult RequestDynamicInterfaceServer(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
ucom::ant::object_ptr< streaming::ant::IRunner > RegisterRunner(const char *strName, CALLABLE &&fnRunFunction)
Definition graph_object.h:1424
cGraphObject()
Default Constructor.
tResult ConfigureDataOutTrigger(const char *strRunnerName, const char *strPinName)
ReaderType * CreateInputPin(const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
Definition graph_object.h:1215
void CreateInterfaceServer(const char *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
Definition graph_object.h:1346
tRecoverableAction
Definition graph_object.h:1064
@ Fatal
Treat as a fatal error.
Definition graph_object.h:1066
@ Log
Log only, continue processing.
Definition graph_object.h:1065
void SetEditor(const char *strName, const char *strUrl)
virtual tResult AcceptType(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
RequestableWriterType * CreateRequestableOutputPin(const char *strName, const cStreamTypeHelper &oType=streaming::ant::stream_meta_type_anonymous())
Definition graph_object.h:1444
streaming::ant::IRunner * CreateRunner(const char *strName, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
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().
tResult RegisterRunner(const char *strName, adtf::base::ant::IRunnable &oRunnable) override
void SetupStreamer(std::shared_ptr< streaming::flash::ISampleStreamer > pStreamer, const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
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().
util::log::ILogChannel * GetLogChannel(std::string_view strName={})
std::shared_ptr< ReaderType > CreateReader(const char *strName, const cStreamTypeHelper &oType)
Definition graph_object.h:1388
tResult ConfigureDataInTrigger(const char *strRunnerName, const char *strPinName)
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::ISample > &pSample)
ucom::ant::object_ptr< services::ant::IReferenceClock > _clock
Definition graph_object.h:1180
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().
virtual tResult RequestDynamicInputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnSampleCallback, bool bForwardTriggerViaOutputPins=true)
Definition stream_type_helper.h:31
ucom::ant::object_ptr< const streaming::ant::IStreamType > GetStreamType() const
Definition graph_object.h:66
bool IsValid()
Definition graph_object.h:87
interface_client()=default
default constructor that initializes the object to an invalid state.
interface_client(const ucom::ant::iobject_ptr< streaming::ant::IBindingClient > &pClient)
Definition graph_object.h:75
Interface & Get() const
Definition graph_object.h:105
Definition runner_intf.h:24
Definition interface_binding_type.h:96
Definition data_binding.h:25
Definition interface_binding.h:23
virtual tResult RegisterBindingObject(const ucom::ant::iobject_ptr< IBindingObject > &pBindingObject)
Definition runtime_behaviour.h:22
Definition samplestreamer_intf.h:188
Definition samplestreamer_intf.h:234
Definition named_graph_object.h:129
Definition samplewriter.h:361
Definition samplewriter.h:499
Definition sample_data.h:429
adtf::base::flash::tNanoSeconds GetTimeNs() const
Definition sample_data.h:491
Safely retrieve a valid object_ptr<> instance to *this when all we have is *this.
Definition object_ptr_utilities.h:40
object_ptr< T > object_ptr_from_this()
Retrieve an object_ptr with *this being the shared resource.
Definition object_ptr_utilities.h:57
Base object pointer to realize binary compatible reference counting in interface methods.
Definition object_ptr_intf.h:112
Definition lockedobject_intf.h:273
Definition object_ptr.h:384
Namespace for the ADTF Base SDK.
Definition adtf_base_type_traits.h:13
Namespace for all functionality of the ADTF Filter SDK provided since v3.0.
Definition filter.h:26
Namespace for all functionality of the ADTF Filter SDK provided since v3.5.
Definition triggered_filter.h:179
Namespace for the ADTF Filter SDK.
Definition configurable_runner.h:18
adtf::streaming::flash::sample_writer< DATA_TYPE > pin_writer
Definition graph_object.h:45
adtf::streaming::flash::size_limited_sample_reader< MAX_SIZE, STORELASTSAMPLE > size_limited_pin_reader
Definition graph_object.h:56
adtf::streaming::flash::cSampleWriter cPinWriter
use cSampleWriter as cPinWriter
Definition graph_object.h:41
adtf::streaming::flash::cDynamicSampleReader cPinReader
use cSampleReader as cPinReader
Definition graph_object.h:48
adtf::streaming::flash::time_limited_sample_reader< TIME_RANGE, STORELASTSAMPLE > time_limited_pin_reader
Definition graph_object.h:52
Namespace for a summary of all service interfaces provided by ADTF.
Definition rpc_object_server_registry_intf.h:80
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
sample_reader< ant::size_limited_sample_reader_queue< MAX_SIZE >, STORELASTSAMPLE > size_limited_sample_reader
Definition samplereader.h:1121
sample_reader< ant::cDynamicSampleReaderQueue > cDynamicSampleReader
The cDynamicSampleReader will create a sample reader which will create a internal sample queue with u...
Definition samplereader.h:1107
sample_reader< ant::time_limited_sample_reader_queue< TIME_RANGE >, STORELASTSAMPLE > time_limited_sample_reader
Definition samplereader.h:1114
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
uint32_t get_sample_substream_id(const ant::ISample &oSample)
base::flash::tNanoSeconds get_sample_time(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
Namespace for all functionality of the ADTF UCOM SDK provided since v3.0.
Definition test_runtime.h:14
object_ptr< T > ucom_object_ptr_cast(object_ptr< T > oCasted)
Create an object_ptr with an already shared resource of implicitly convertible type.
Definition object_ptr_utilities.h:104
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Definition object_ptr_utilities.h:129
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
constexpr const char * get_iid() noexcept
Alias bringing the latest version of ant::get_iid() into scope.
Definition adtf_iid.h:429
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
#define adtf_string_intf(__string__)
Definition string_intf.h:465
A timestamp with nanosecond precision.
Definition chrono.h:23
Use this Stream Meta Type only if no property should be set and you do not share and record these dat...
Definition streammetatypeanonymous.h:22