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
173 public base::cConfiguration
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::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
1082 void SetMainThreadAffinity(bool bEnabled);
1083
1085
1086public:
1090 enum class tRecoverableAction : uint8_t
1091 {
1092 Log = 0,
1094 };
1095
1113 util::log::ILogChannel* CreateLogChannel(
1114 std::string_view strName,
1116 tRecoverableAction eDefaultRecoverableAction = tRecoverableAction::Log,
1117 util::log::tLogLevel eDefaultLogLevel = util::log::tLogLevel::Detail);
1118
1130 util::log::ILogChannel* GetLogChannel(std::string_view strName = {});
1131
1136 util::log::ILogChannel* a_util_get_current_log_channel() const noexcept;
1137
1138 tResult SetName(const char* strName);
1139 tResult SetParent(const ucom::ant::IObject* oParentObject);
1140
1141 ucom::object_ptr<services::ant::IMacroResolver> GetParentMacroResolver() const;
1142
1143protected:
1154 void SetupStreamer(std::shared_ptr<streaming::flash::ISampleStreamer> pStreamer,
1155 const char* strName,
1156 const ucom::ant::iobject_ptr<const streaming::ant::IStreamType>& pType);
1157
1162 void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1163 bool bDataInTrigger = true,
1164 bool bForwardTriggerViaOutputPins = true);
1165
1170 template<typename CALLABLE,
1171 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool> =
1172 true>
1173 void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1174 CALLABLE&& fnTriggerCallback,
1175 bool bForwardTriggerViaOutputPins);
1176
1180 void CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1181 const char* strTriggerFunctionName,
1182 bool bForwardTriggerViaOutputPins = true);
1183
1188 void CreateOutputPin(std::shared_ptr<streaming::flash::ISampleWriter> pWriter);
1189
1190 void ConfigureRunner(streaming::ant::IRunner* pRunner,
1191 const cTriggerHint& oTriggerHint,
1192 bool bForwardTriggerViaOutputPins);
1193
1194 std::string GetFullName();
1195
1196protected:
1207 ucom::ant::object_ptr<services::ant::IReferenceClock> _clock;
1208
1209protected:
1210 class cImplementation;
1211 std::unique_ptr<cImplementation> m_pImplementation;
1212
1213private:
1214 void LockedCallEnableSubStream(streaming::flash::ISampleWriter* pWriter,
1215 uint32_t nSubStreamId,
1216 const base::ant::IProperties* pRequestProperties);
1217 void LockedCallDisableSubStream(streaming::flash::ISampleWriter* pWriter, uint32_t nSubStreamId);
1218 std::recursive_mutex& GetProcessMutex();
1219};
1220
1221template<typename CALLABLE,
1222 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1223void cGraphObject::CreateInputPin(std::shared_ptr<streaming::flash::ISampleReader> pReader,
1224 CALLABLE&& fnTriggerCallback,
1225 bool bForwardTriggerViaOutputPins)
1226{
1227 std::string strName;
1228 pReader->GetName(base::adtf_string<std::string>(&strName));
1229 const auto strTriggerFunctionName = "process_" + strName;
1230 const auto pRunner = RegisterRunner(
1231 strTriggerFunctionName.c_str(),
1232 [fnTriggerCallback = std::forward<CALLABLE>(fnTriggerCallback), this](base::tNanoSeconds tmTrigger) -> tResult
1233 {
1234 std::lock_guard<std::recursive_mutex> oGuard(GetProcessMutex());
1235 RETURN_IF_FAILED(fnTriggerCallback(tmTrigger));
1236 RETURN_NOERROR;
1237 });
1238 CreateInputPin(pReader, strTriggerFunctionName.c_str(), bForwardTriggerViaOutputPins);
1239}
1240
1241template<typename ReaderType>
1242ReaderType* cGraphObject::CreateInputPin(const char* strName, bool bDataInTrigger, bool bForwardTriggerViaOutputPins)
1243{
1244 return CreateInputPin<ReaderType>(strName, streaming::stream_meta_type_anonymous(), bDataInTrigger,
1245 bForwardTriggerViaOutputPins);
1246}
1247
1248template<typename ReaderType>
1249ReaderType* cGraphObject::CreateInputPin(const char* strName,
1250 const cStreamTypeHelper& oType,
1251 bool bDataInTrigger,
1252 bool bForwardTriggerViaOutputPins)
1253{
1254 auto pReader = CreateReader<ReaderType>(strName, oType);
1255 CreateInputPin(pReader, bDataInTrigger, bForwardTriggerViaOutputPins);
1256 return pReader.get();
1257}
1258
1259template<typename ReaderType,
1260 typename CALLABLE,
1261 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1262ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1263 const cStreamTypeHelper& oType,
1264 CALLABLE&& fnTriggerCallback,
1265 bool bForwardTriggerViaOutputPins)
1266{
1267 auto pReader = CreateReader<ReaderType>(strName, oType);
1268 CreateInputPin(pReader, std::forward<CALLABLE>(fnTriggerCallback), bForwardTriggerViaOutputPins);
1269 return pReader.get();
1270}
1271
1272template<typename ReaderType,
1273 typename CALLABLE,
1274 std::enable_if_t<std::is_invocable_r_v<tResult,
1275 std::decay_t<CALLABLE>,
1277 bool>>
1278ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1279 const cStreamTypeHelper& oType,
1280 CALLABLE&& fnSampleCallback,
1281 bool bForwardTriggerViaOutputPins)
1282{
1283 auto pReader = CreateReader<ReaderType>(strName, oType);
1285 pReader,
1286 [fnSampleCallback = std::forward<CALLABLE>(fnSampleCallback), pReader](base::tNanoSeconds) -> tResult
1287 {
1289 while (IS_OK(pReader->GetNextSample(pSample)))
1290 {
1291 RETURN_IF_FAILED_DESC(fnSampleCallback(pSample),
1292 "Error while processing sample with timestamp = %" PRIi64
1293 "ns, substream id = %" PRIu32 " and buffer size = %zu",
1294 streaming::get_sample_time(pSample).nCount,
1296 [&]() -> size_t
1297 {
1299 if (IS_OK(pSample->Lock(pBuffer)))
1300 {
1301 return pBuffer->GetSize();
1302 }
1303
1304 return 0;
1305 }());
1306 }
1307
1309 },
1310 bForwardTriggerViaOutputPins);
1311 return pReader.get();
1312}
1313
1314template<typename ReaderType,
1315 typename CALLABLE,
1316 std::enable_if_t<
1317 std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds, const void*, size_t>,
1318 bool>>
1319ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1320 const cStreamTypeHelper& oType,
1321 CALLABLE&& fnSampleDataCallback,
1322 bool bForwardTriggerViaOutputPins)
1323{
1325 strName, oType,
1326 [fnSampleDataCallback = std::forward<CALLABLE>(fnSampleDataCallback)](
1328 {
1329 ucom::object_ptr_shared_locked<const streaming::ISampleBuffer> pBuffer;
1330 RETURN_IF_FAILED(pSample->Lock(pBuffer));
1331 return fnSampleDataCallback(streaming::get_sample_time(pSample), pBuffer->GetPtr(), pBuffer->GetSize());
1332 },
1333 bForwardTriggerViaOutputPins);
1334}
1335
1336template<
1337 typename Type,
1338 typename ReaderType,
1339 typename CALLABLE,
1340 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds, const Type&>,
1341 bool>>
1342ReaderType* cGraphObject::CreateInputPinWithCallback(const char* strName,
1343 const cStreamTypeHelper& oType,
1344 CALLABLE&& fnDataCallback,
1345 bool bForwardTriggerViaOutputPins)
1346{
1348 strName, oType,
1349 [fnDataCallback = std::forward<CALLABLE>(fnDataCallback)](
1351 {
1352 streaming::sample_data<Type> oSampleData(pSample);
1353 return fnDataCallback(oSampleData.GetTimeNs(), *oSampleData);
1354 },
1355 bForwardTriggerViaOutputPins);
1356}
1357
1358template<typename WriterType>
1359WriterType* cGraphObject::CreateOutputPin(const char* strName)
1360{
1361 return CreateOutputPin<WriterType>(strName, cStreamTypeHelper(nullptr));
1362}
1363
1364template<typename WriterType>
1365WriterType* cGraphObject::CreateOutputPin(const char* strName, const cStreamTypeHelper& oType)
1366{
1367 auto pWriter = CreateWriter<WriterType>(strName, oType);
1368 CreateOutputPin(pWriter);
1369 return pWriter.get();
1370}
1371
1372template<typename Interface, typename Instance>
1375{
1376 auto pInstancePointer = pInstance->object_ptr_from_this();
1377 if (!pInstancePointer)
1378 {
1379 THROW_ERROR_DESC(ERR_NOT_INITIALIZED,
1380 "Unable to add interface server '%s', object_ptr_from_this has not been initialized. "
1381 "This AddInterfaceServer overload cannot be called from within the constructor.",
1382 strName);
1383 }
1384 using namespace adtf::ucom::ant;
1385 using namespace adtf::streaming::ant;
1388 ucom_object_ptr_cast<IObject>(pInstancePointer));
1389 THROW_IF_FAILED(RegisterBindingObject(pBindingServer));
1390}
1391
1392template<typename Interface>
1402
1403template<typename Interface>
1413
1414template<typename ReaderType>
1415std::shared_ptr<ReaderType> cGraphObject::CreateReader(const char* strName, const cStreamTypeHelper& oType)
1416{
1417 auto pReader = std::make_shared<ReaderType>();
1418 SetupStreamer(pReader, strName, oType.GetStreamType());
1419 pReader->SetAcceptTypeCallback(
1420 [pReader = pReader.get(),
1422 {
1423 util::log::cCurrentThreadDefaultLogChannel oLogger(a_util_get_current_log_channel());
1424 return AcceptType(pReader, pType);
1425 });
1426 return pReader;
1427}
1428
1429template<typename WriterType>
1430std::shared_ptr<WriterType> cGraphObject::CreateWriter(const char* strName, const cStreamTypeHelper& oType)
1431{
1432 auto pWriter = std::make_shared<WriterType>();
1433 SetupStreamer(pWriter, strName, oType.GetStreamType());
1434 return pWriter;
1435}
1436
1437template<typename CALLABLE,
1438 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1440 CALLABLE&& fnRunFunction,
1441 const cTriggerHint& oTriggerHint,
1442 bool bForwardTriggerViaOutputPins)
1443{
1444 auto pRunner = RegisterRunner(strName, std::forward<CALLABLE>(fnRunFunction));
1445 ConfigureRunner(pRunner.Get(), oTriggerHint, bForwardTriggerViaOutputPins);
1446 return pRunner.Get();
1447}
1448
1449template<typename CALLABLE,
1450 std::enable_if_t<std::is_invocable_r_v<tResult, std::decay_t<CALLABLE>, base::flash::tNanoSeconds>, bool>>
1452 CALLABLE&& fnRunFunction)
1453{
1456 strName, GetLogChannel(),
1457 [this, fnRunFunction = std::forward<CALLABLE>(fnRunFunction),
1458 strName = std::string(strName)](base::flash::tNanoSeconds tmTrigger) -> tResult
1459 {
1460 RETURN_IF_FAILED_DESC(fnRunFunction(tmTrigger),
1461 "Error while processing trigger with timestamp %" PRIi64 "ns on %s.%s",
1462 tmTrigger.nCount, GetFullName().c_str(), strName.c_str());
1463
1465 });
1467 return pRunner;
1468}
1469
1470template<typename RequestableWriterType>
1471RequestableWriterType* cGraphObject::CreateRequestableOutputPin(const char* strName, const cStreamTypeHelper& oType)
1472{
1473 auto pWriter = CreateWriter<RequestableWriterType>(strName, oType);
1474 CreateOutputPin(pWriter);
1475 pWriter->SetCallbacks(
1476 std::bind(&cGraphObject::LockedCallEnableSubStream, this, pWriter.get(), std::placeholders::_1,
1477 std::placeholders::_2),
1478 std::bind(&cGraphObject::LockedCallDisableSubStream, this, pWriter.get(), std::placeholders::_1));
1479 return pWriter.get();
1480}
1481
1482} // namespace filter
1483} // 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:775
#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
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
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:1359
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)
void SetMainThreadAffinity(bool bEnabled)
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:1404
~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)
void RegisterPropertyVariable(const char *strName, base::cPropertyVariable &oPropertyVariable)
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
Definition graph_object.h:1262
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:1430
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:1451
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:1242
void CreateInterfaceServer(const char *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
Definition graph_object.h:1373
tRecoverableAction
Definition graph_object.h:1091
@ Fatal
Treat as a fatal error.
Definition graph_object.h:1093
@ Log
Log only, continue processing.
Definition graph_object.h:1092
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:1471
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:1415
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:1207
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:135
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:160
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:446
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