ADTF  3.18.2
triggerpipe_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <adtfucom3/adtf_ucom3.h>
9 #include <adtfbase/adtf_base.h>
10 
11 namespace adtf
12 {
13 namespace streaming
14 {
15 namespace ant
16 {
17  class ITriggerPipeItem;
26  {
27  protected:
29  ~ITriggerPipeSource() = default;
30  public:
32  ADTF_IID(ITriggerPipeSource, "trigger_pipe_source.ant.streaming.adtf.iid");
33  public:
36  enum tPriority : uint32_t
37  {
39  Invalid = 0,
41  Lowest = 1,
43  Lower = 30,
47  Normal = 50,
51  Higher = 70,
53  Highest = 100
54  };
55 
56  public:
67  tPriority ui32Prio) = 0;
76 
86  tPriority ui32Prio) = 0;
95  };
96 
101  public ITriggerPipeSource
102  {
103  protected:
105  ~ITriggerPipeItem() = default;
106  public:
108  ADTF_IID(ITriggerPipeItem, "trigger_pipe_item.ant.streaming.adtf.iid");
109  };
110 
118  {
119  protected:
121  ~ITriggerPipe() = default;
122  public:
124  ADTF_IID(ITriggerPipe, "trigger_pipe.ant.streaming.adtf.iid");
125  public:
126 
135 
141  virtual tResult Open() = 0;
142 
147  virtual tResult Close() = 0;
148 
154  virtual tResult GetName(adtf::base::ant::IString&& strName) const = 0;
155  };
156 
157 
158 } //namespace ant
159 
160 namespace quiet
161 {
162 
167 {
168  protected:
171  public:
173  ADTF_IID(ITriggerPipeHierachy, "trigger_pipe_hierachy.quiet.streaming.adtf.iid");
174 
181 
188 
194  virtual tResult GetTriggerParents(const ucom::nitro::ifunction<tResult(const ant::ITriggerPipeSource*)>& fnCallback) const = 0;
195 };
196 
197 }
198 
199 namespace riddler
200 {
201 
208 template <typename ObjectType>
209 inline bool has_trigger_parent(const ObjectType* pChild)
210 {
211  const auto pHierachy = adtf::ucom::ucom_cast<const quiet::ITriggerPipeHierachy*>(pChild);
212  if (!pHierachy)
213  {
214  THROW_ERROR_DESC(ERR_NO_INTERFACE, "Object does not implement the trigger pipe hierachy interface.");
215  }
216 
217  bool bHasParent = false;
218  pHierachy->GetTriggerParents(adtf::ucom::make_function([&](const ant::ITriggerPipeSource*) -> tResult { bHasParent = true; RETURN_ERROR(ERR_CANCELED);}));
219  return bHasParent;
220 }
221 
222 }
223 
225 using ant::ITriggerPipeSource;
227 using ant::ITriggerPipeItem;
229 using ant::ITriggerPipe;
231 using quiet::ITriggerPipeHierachy;
233 using riddler::has_trigger_parent;
234 
235 } //namespace streaming
236 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
The Runnable interface defines common methods for a running component.
Definition: runnable_intf.h:26
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition: string_intf.h:28
virtual tResult Open()=0
Opens and register every added pipe items.
virtual tResult GetFirstItem(adtf::ucom::ant::iobject_ptr< const ITriggerPipeSource > &pSubRu) const =0
Retrieves the first source item of the defined Trigger Pipe.
ADTF_IID(ITriggerPipe, "trigger_pipe.ant.streaming.adtf.iid")
Definiton of interface id.
~ITriggerPipe()=default
not destructable
virtual tResult Close()=0
Close and unregister every pipe item from its ITriggerPipeSource.
virtual tResult GetName(adtf::base::ant::IString &&strName) const =0
Gets the name of the Pipe.
Interface for objects which can participate a ITriggerPipe.
~ITriggerPipeItem()=default
not destructable
ADTF_IID(ITriggerPipeItem, "trigger_pipe_item.ant.streaming.adtf.iid")
Definition of interface ID.
Interface that defines a TriggerPipeSource, which is able to send a Run (RUN::TIrgger) call to the re...
virtual tResult ChangePriority(const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun, tPriority ui32Prio)=0
Changes the priority of the pSubRun.
virtual tResult RegisterSubItem(const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun, tPriority ui32Prio)=0
Registers the pSubRun as SubItem of the source.
virtual tResult GetSubItems(adtf::ucom::ant::iobject_enum< const ITriggerPipeItem > &lstSubItems) const =0
Retrieves a list of the registered Items.
virtual tResult UnregisterSubItem(const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun)=0
Unregisters the pSubRun from the source.
~ITriggerPipeSource()=default
not destructable
ADTF_IID(ITriggerPipeSource, "trigger_pipe_source.ant.streaming.adtf.iid")
definiton of interface id
tPriority
Priority used for the order of ITriggerPipeItem::Run calls.
Interface for accessing the parent of a trigger pipe item.
virtual tResult GetTriggerParents(const ucom::nitro::ifunction< tResult(const ant::ITriggerPipeSource *)> &fnCallback) const =0
Retrieve all trigger pipe parents of this item.
virtual tResult UnregisterTriggerParent(const ant::ITriggerPipeSource *pParent)=0
Unregisters the given trigger pipe source that is no longer a parent of this item;.
virtual tResult RegisterTriggerParent(const ant::ITriggerPipeSource *pParent)=0
Registers the given trigger pipe source as a parent of this item;.
ADTF_IID(ITriggerPipeHierachy, "trigger_pipe_hierachy.quiet.streaming.adtf.iid")
Definition of interface ID.
~ITriggerPipeHierachy()=default
not destructable
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
Interface definition for a container of objects.
Definition: object_list.h:22
Base object pointer to realize binary compatible reference counting in interface methods.
Interface for functions that can be passed via IObject interfaces.
Definition: function_ptr.h:28
function_wrapper< Signature > make_function(Callable &&fnCallback)
creates a ucom_function object for the given callable.
Definition: function_ptr.h:159
Namespace for entire ADTF SDK.
bool has_trigger_parent(const ObjectType *pChild)
Checks whether the object has a parent trigger item or not.
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception