ADTF  3.18.2
runnable_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "chrono.h"
9 #include <adtfucom3/adtf_ucom3.h>
10 
11 #include <functional>
12 
13 namespace adtf
14 {
15 namespace base
16 {
17 namespace ant
18 {
19 
25 class IRunnable
26 {
27  public:
29  ADTF_IID(IRunnable, "runnable.ant.base.adtf.iid");
30 
31  protected:
33  ~IRunnable() = default;
34 
35  public:
37  typedef std::function<tResult(tTimeStamp)> tRunFunction;
38 
43  enum tActivationType : uint32_t
44  {
48  RUN_TIMER = 1,
58  RUN_JOB = 7,
62  RUN_PUSH = 9,
63 
65  RUN_USER = 0x1000
66  };
67 
68  public:
81  virtual tResult Run(tTimeStamp tmTimeofActivation,
82  tActivationType ui32ActivationType,
83  const void* pvUserData,
84  size_t nUserDataSize) = 0;
85 
86 
93  {
94  return RUN_UNSPECIFIED;
95  }
96 };
97 } //namespace ant
98 
99 namespace flash
100 {
101 
103 {
104  public:
106  ADTF_IID(IRunnable, "runnable.flash.base.adtf.iid");
107 
108  protected:
110  ~IRunnable() = default;
111 
112  public:
114  typedef std::function<tResult(tNanoSeconds)> tRunFunction;
116 
117  public:
118 
131  virtual tResult Run(tNanoSeconds tmTimeofActivation,
132  ant::IRunnable::tActivationType ui32ActivationType,
133  const void* pvUserData,
134  size_t nUserDataSize) = 0;
135 };
136 
137 
138 }
139 
141 using ant::IRunnable;
142 
143 } //namespace base
144 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
The Runnable interface defines common methods for a running component.
Definition: runnable_intf.h:26
virtual tResult Run(tTimeStamp tmTimeofActivation, tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize)=0
The Run method to set the component in running state.
tActivationType
Enumeration of the possible activation types to set a component in running state.
Definition: runnable_intf.h:44
@ RUN_USER
activation code offset for user activations.
Definition: runnable_intf.h:65
@ RUN_TIMER
activation code to handle a timer, usually this is sent by a kernel implementation have timer primiti...
Definition: runnable_intf.h:48
@ RUN_SIGNAL
activation code to handle a signal event, usually this is sent by a kernel implementation have signal...
Definition: runnable_intf.h:50
@ RUN_TRIGGER
Trigger run call.
Definition: runnable_intf.h:60
@ RUN_PUSH
Data Sync Push.
Definition: runnable_intf.h:62
@ RUN_EXCEPTION
activation code to handle a global exception.
Definition: runnable_intf.h:52
@ RUN_THREAD
activation code to handle a thread call, usually this is sent by a kernel implementation have thread ...
Definition: runnable_intf.h:56
@ RUN_JOB
activation code to handle a job call.
Definition: runnable_intf.h:58
@ RUN_MESSAGE
activation code to handle a message.
Definition: runnable_intf.h:54
@ RUN_UNSPECIFIED
unspecified Run activation type.
Definition: runnable_intf.h:46
~IRunnable()=default
not destructable
ADTF_IID(IRunnable, "runnable.ant.base.adtf.iid")
defintion of interface id
virtual tActivationType GetActivationType() const
Gets the activation code of the runnable it reacts to.
Definition: runnable_intf.h:92
std::function< tResult(tTimeStamp)> tRunFunction
Type defintion of the function used to implement Run.
Definition: runnable_intf.h:37
std::function< tResult(tNanoSeconds)> tRunFunction
Type defintion of the function used to implement Run.
~IRunnable()=default
not destructable
ADTF_IID(IRunnable, "runnable.flash.base.adtf.iid")
defintion of interface id
virtual tResult Run(tNanoSeconds tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize)=0
The Run method to set the component in running state.
Namespace for entire ADTF SDK.
Public API for compatibility to C++11 <chrono>