F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ActiveComponentBase.hpp
Go to the documentation of this file.
1 /*
2  * ActiveComponentBase.hpp
3  *
4  * Created on: Aug 14, 2012
5  * Author: tcanham
6  */
7 
8 /*
9  * Description:
10  */
11 #ifndef FW_ACTIVE_COMPONENT_BASE_HPP
12 #define FW_ACTIVE_COMPONENT_BASE_HPP
13 
15 #include <Os/Task.hpp>
16 #include <FpConfig.hpp>
17 
18 
19 namespace Fw {
21  public:
22  void start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity = -1);
23  void exit(void);
24  Os::Task::TaskStatus join(void **value_ptr);
25 
26  enum {
28  };
29 
31  ActiveComponentBase(const char* name);
32  virtual ~ActiveComponentBase();
33  void init(NATIVE_INT_TYPE instance);
34  virtual void preamble(void);
35  virtual void loop(void);
36  virtual void finalizer(void);
38 #if FW_OBJECT_TO_STRING == 1
39  virtual void toString(char* str, NATIVE_INT_TYPE size);
40 #endif
42  static void s_baseTask(void*);
43  static void s_baseBareTask(void*);
44  };
45 
46 }
47 #endif
Fw::ActiveComponentBase::s_baseBareTask
static void s_baseBareTask(void *)
function provided to task class for new thread.
Definition: ActiveComponentBase.cpp:86
Fw::ActiveComponentBase::m_task
Os::Task m_task
task object for active component
Definition: ActiveComponentBase.hpp:37
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Fw::ActiveComponentBase::join
Os::Task::TaskStatus join(void **value_ptr)
provide return value of thread if value_ptr is not NULL
Definition: ActiveComponentBase.cpp:81
Fw::ActiveComponentBase::preamble
virtual void preamble(void)
A function that will be called before the event loop is entered.
Definition: ActiveComponentBase.cpp:143
Task.hpp
Fw::ActiveComponentBase::start
void start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity=-1)
called by instantiator when task is to be started
Definition: ActiveComponentBase.cpp:52
PROTECTED
#define PROTECTED
overridable protected for unit testing
Definition: BasicTypes.hpp:114
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Definition: ActiveComponentBase.hpp:27
Os::Task::TaskStatus
TaskStatus
Definition: Task.hpp:18
Fw::ActiveComponentBase::finalizer
virtual void finalizer(void)
A function that will be called after exiting the loop.
Definition: ActiveComponentBase.cpp:146
Fw::ActiveComponentBase
Definition: ActiveComponentBase.hpp:20
Fw::QueuedComponentBase
Definition: QueuedComponentBase.hpp:21
FpConfig.hpp
ISF configuration file.
Fw::ActiveComponentBase::~ActiveComponentBase
virtual ~ActiveComponentBase()
Destructor.
Definition: ActiveComponentBase.cpp:37
Os::Task
forward declaration
Definition: Task.hpp:15
Fw::ActiveComponentBase::exit
void exit(void)
exit task in active component
Definition: ActiveComponentBase.cpp:73
QueuedComponentBase.hpp
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw
Definition: BufferGetPortAc.cpp:6
Fw::ActiveComponentBase::loop
virtual void loop(void)
The function that will loop dispatching messages.
Definition: ActiveComponentBase.cpp:125