ADTF
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 #include <adtf_base_deprecated.h>
11 
12 #include <functional>
13 
14 namespace adtf
15 {
16 namespace base
17 {
18 namespace ant
19 {
20 
26 class IRunnable
27 {
28  public:
30  ADTF_IID(IRunnable, "runnable.ant.base.adtf.iid");
31 
32  protected:
34  ~IRunnable() = default;
35 
36  public:
38  typedef std::function<tResult(tTimeStamp)> tRunFunction;
39 
44  enum tActivationType : uint32_t
45  {
49  RUN_TIMER = 1,
59  RUN_JOB = 7,
63  RUN_PUSH = 9,
64 
66  RUN_USER = 0x1000
67  };
68 
69  public:
83  ADTF3_DEPRECATED("Use adtf::base::flash::IRunnable::Run(tNanoSeconds tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void* pvUserData, size_t nUserDataSize) instead.")
84  virtual tResult Run(tTimeStamp tmTimeofActivation,
85  tActivationType ui32ActivationType,
86  const void* pvUserData,
87  size_t nUserDataSize) = 0;
88 
89 
96  {
97  return RUN_UNSPECIFIED;
98  }
99 };
100 } //namespace ant
101 
102 namespace flash
103 {
104 
106 {
107  public:
109  ADTF_IID(IRunnable, "runnable.flash.base.adtf.iid");
110 
111  protected:
113  ~IRunnable() = default;
114 
115  public:
117  typedef std::function<tResult(tNanoSeconds)> tRunFunction;
119 
120  public:
121 
134  virtual tResult Run(tNanoSeconds tmTimeofActivation,
135  ant::IRunnable::tActivationType ui32ActivationType,
136  const void* pvUserData,
137  size_t nUserDataSize) = 0;
138 };
139 
140 
141 }
142 
144 using ant::IRunnable;
145 
146 } //namespace base
147 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
#define ADTF3_DEPRECATED(_depr_message_)
Mark a function or variable as deprecated.
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:27
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:45
@ RUN_USER
activation code offset for user activations.
Definition: runnable_intf.h:66
@ RUN_TIMER
activation code to handle a timer, usually this is sent by a kernel implementation have timer primiti...
Definition: runnable_intf.h:49
@ RUN_SIGNAL
activation code to handle a signal event, usually this is sent by a kernel implementation have signal...
Definition: runnable_intf.h:51
@ RUN_TRIGGER
Trigger run call.
Definition: runnable_intf.h:61
@ RUN_PUSH
Data Sync Push.
Definition: runnable_intf.h:63
@ RUN_EXCEPTION
activation code to handle a global exception.
Definition: runnable_intf.h:53
@ RUN_THREAD
activation code to handle a thread call, usually this is sent by a kernel implementation have thread ...
Definition: runnable_intf.h:57
@ RUN_JOB
activation code to handle a job call.
Definition: runnable_intf.h:59
@ RUN_MESSAGE
activation code to handle a message.
Definition: runnable_intf.h:55
@ RUN_UNSPECIFIED
unspecified Run activation type.
Definition: runnable_intf.h:47
~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:95
std::function< tResult(tTimeStamp)> tRunFunction
Type definition of the function used to implement Run.
Definition: runnable_intf.h:38
std::function< tResult(tNanoSeconds)> tRunFunction
Type definition 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>