F´ Flight Software - C/C++ Documentation
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 <Fw/FPrimeBasicTypes.hpp>
16 #include <Os/Queue.hpp>
17 #include <Os/Task.hpp>
18 
19 namespace Fw {
21  public:
22  // Note: Had to make MsgDispatchStatus public for LLVM.
23  typedef enum {
29 
30  protected:
31  QueuedComponentBase(const char* name);
32  virtual ~QueuedComponentBase();
33  void init(FwEnumStoreType instance);
34  void deinit();
37  virtual MsgDispatchStatus doDispatch() = 0;
38 #if FW_OBJECT_TO_STRING == 1
39  virtual const char* getToStringFormatString();
40 #endif
42  void incNumMsgDropped();
43  private:
44  FwSizeType m_msgsDropped;
45 };
46 
47 } // namespace Fw
48 #endif
virtual ~QueuedComponentBase()
Destructor.
PlatformSizeType FwSizeType
I32 FwEnumStoreType
Status
status returned from the queue send function
Definition: Queue.hpp:30
QueuedComponentBase(const char *name)
Constructor.
virtual MsgDispatchStatus doDispatch()=0
method to dispatch a single message in the queue.
Os::Queue m_queue
queue object for active component
void init()
Object initializer.
Definition: ObjBase.cpp:24
FwSizeType getNumMsgsDropped()
return number of messages dropped
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void deinit()
Allows de-initialization on teardown.
A message was sent requesting an exit of the loop.
void incNumMsgDropped()
increment the number of messages dropped
Implementation of malloc based allocator.