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  void deinit() override;
30 
31  protected:
32  QueuedComponentBase(const char* name);
33  virtual ~QueuedComponentBase();
34  void init(FwEnumStoreType instance);
37  virtual MsgDispatchStatus doDispatch() = 0;
38 
45 #if FW_OBJECT_TO_STRING == 1
46  const char* getToStringFormatString() override;
47 #endif
49  void incNumMsgDropped();
50  private:
51  FwSizeType m_msgsDropped;
52 };
53 
54 } // namespace Fw
55 #endif
MsgDispatchStatus dispatchAvailableMessages()
dispatches all messages currently in the queue, returning status of the dispatch
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() override
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.