F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
QueuedComponentBase.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_QUEUED_COMPONENT_BASE_HPP
12 #define FW_QUEUED_COMPONENT_BASE_HPP
13 
15 #include <Os/Queue.hpp>
16 #include <Os/Task.hpp>
17 #include <FpConfig.hpp>
18 
19 
20 namespace Fw {
22  public:
23 
24  // Note: Had to make MsgDispatchStatus public for LLVM.
25  typedef enum {
31 
32  PROTECTED:
33  QueuedComponentBase(const char* name);
34  virtual ~QueuedComponentBase();
35  void init(NATIVE_INT_TYPE instance);
39 #if FW_OBJECT_TO_STRING == 1
40  virtual void toString(char* str, NATIVE_INT_TYPE size);
41 #endif
43  void incNumMsgDropped();
44  PRIVATE:
45  NATIVE_INT_TYPE m_msgsDropped;
46  };
47 
48 }
49 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition: ObjBase.cpp:27
QueuedComponentBase(const char *name)
Constructor.
Os::Queue::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
virtual MsgDispatchStatus doDispatch()=0
method to dispatch a single message in the queue.
Os::Queue m_queue
queue object for active component
void incNumMsgDropped()
increment the number of messages dropped
@ MSG_DISPATCH_EMPTY
No more messages in the queue.
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
NATIVE_INT_TYPE getNumMsgsDropped()
return number of messages dropped
virtual ~QueuedComponentBase()
Destructor.
QueueStatus
Definition: Queue.hpp:27