F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Svc::BufferAccumulator Class Referencefinal

#include <Svc/BufferAccumulator/BufferAccumulator.hpp>

Inheritance diagram for Svc::BufferAccumulator:
Svc::BufferAccumulatorComponentBase Fw::ActiveComponentBase Fw::QueuedComponentBase Fw::PassiveComponentBase Fw::ObjBase

Public Member Functions

 BufferAccumulator (const char *const compName)
 
 ~BufferAccumulator ()
 
void allocateQueue (FwEnumStoreType identifier, Fw::MemAllocator &allocator, FwSizeType maxNumBuffers)
 
void deallocateQueue (Fw::MemAllocator &allocator)
 Return allocated queue. Should be done during shutdown. More...
 
- Public Member Functions inherited from Svc::BufferAccumulatorComponentBase
void init (FwSizeType queueDepth, FwEnumStoreType instance=0)
 Initialize BufferAccumulatorComponentBase object. More...
 
Fw::InputCmdPortget_cmdIn_InputPort (FwIndexType portNum)
 
Fw::InputBufferSendPortget_bufferSendInFill_InputPort (FwIndexType portNum)
 
Fw::InputBufferSendPortget_bufferSendInReturn_InputPort (FwIndexType portNum)
 
Svc::InputPingPortget_pingIn_InputPort (FwIndexType portNum)
 
void set_cmdRegOut_OutputPort (FwIndexType portNum, Fw::InputCmdRegPort *port)
 Connect port to cmdRegOut[portNum]. More...
 
void set_cmdResponseOut_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port)
 Connect port to cmdResponseOut[portNum]. More...
 
void set_eventOut_OutputPort (FwIndexType portNum, Fw::InputLogPort *port)
 Connect port to eventOut[portNum]. More...
 
void set_timeCaller_OutputPort (FwIndexType portNum, Fw::InputTimePort *port)
 Connect port to timeCaller[portNum]. More...
 
void set_tlmOut_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port)
 Connect port to tlmOut[portNum]. More...
 
void set_bufferSendOutDrain_OutputPort (FwIndexType portNum, Fw::InputBufferSendPort *port)
 Connect port to bufferSendOutDrain[portNum]. More...
 
void set_bufferSendOutReturn_OutputPort (FwIndexType portNum, Fw::InputBufferSendPort *port)
 Connect port to bufferSendOutReturn[portNum]. More...
 
void set_pingOut_OutputPort (FwIndexType portNum, Svc::InputPingPort *port)
 Connect port to pingOut[portNum]. More...
 
void regCommands ()
 Register commands with the Command Dispatcher. More...
 
- Public Member Functions inherited from Fw::ActiveComponentBase
void start (FwTaskPriorityType priority=Os::Task::TASK_PRIORITY_DEFAULT, FwSizeType stackSize=Os::Task::TASK_DEFAULT, FwSizeType cpuAffinity=Os::Task::TASK_DEFAULT, FwTaskIdType identifier=static_cast< FwTaskIdType >(Os::Task::TASK_DEFAULT))
 called by instantiator when task is to be started More...
 
void exit ()
 exit task in active component More...
 
Os::Task::Status join ()
 Join the thread. More...
 
 DEPRECATED (Os::Task::Status join(void **value_ptr), "Switch to .join()")
 Join to thread with discarded value_ptr. More...
 
- Public Member Functions inherited from Fw::QueuedComponentBase
void deinit () override
 Allows de-initialization on teardown. More...
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const FwIdType)
 Set the ID base. More...
 
FwIdType getIdBase () const
 

Friends

class BufferAccumulatorTester
 
class Svc::Accumulate::BufferAccumulatorTester
 
class Svc::Drain::BufferAccumulatorTester
 
class Svc::Errors::BufferAccumulatorTester
 

Additional Inherited Members

- Public Types inherited from Fw::ActiveComponentBase
enum  { ACTIVE_COMPONENT_EXIT }
 
- Public Types inherited from Fw::QueuedComponentBase
enum  MsgDispatchStatus { MSG_DISPATCH_OK, MSG_DISPATCH_EMPTY, MSG_DISPATCH_ERROR, MSG_DISPATCH_EXIT }
 
- Protected Types inherited from Svc::BufferAccumulatorComponentBase
enum  { NUM_CMDIN_INPUT_PORTS = 1 }
 Enumerations for numbers of special input ports. More...
 
enum  { NUM_BUFFERSENDINFILL_INPUT_PORTS = 1, NUM_BUFFERSENDINRETURN_INPUT_PORTS = 1, NUM_PINGIN_INPUT_PORTS = 1 }
 Enumerations for numbers of typed input ports. More...
 
enum  {
  NUM_CMDREGOUT_OUTPUT_PORTS = 1, NUM_CMDRESPONSEOUT_OUTPUT_PORTS = 1, NUM_EVENTOUT_OUTPUT_PORTS = 1, NUM_EVENTOUTTEXT_OUTPUT_PORTS = 1,
  NUM_TIMECALLER_OUTPUT_PORTS = 1, NUM_TLMOUT_OUTPUT_PORTS = 1
}
 Enumerations for numbers of special output ports. More...
 
enum  { NUM_BUFFERSENDOUTDRAIN_OUTPUT_PORTS = 1, NUM_BUFFERSENDOUTRETURN_OUTPUT_PORTS = 1, NUM_PINGOUT_OUTPUT_PORTS = 1 }
 Enumerations for numbers of typed output ports. More...
 
enum  { OPCODE_BA_SETMODE = 0x0, OPCODE_BA_DRAINBUFFERS = 0x1 }
 Command opcodes. More...
 
enum  {
  EVENTID_BA_BUFFERACCEPTED = 0x0, EVENTID_BA_QUEUEFULL = 0x1, EVENTID_BA_STILLDRAINING = 0x2, EVENTID_BA_ALREADYDRAINING = 0x3,
  EVENTID_BA_DRAINSTALLED = 0x4, EVENTID_BA_PARTIALDRAINDONE = 0x5, EVENTID_BA_NONBLOCKDRAIN = 0x6
}
 Event IDs. More...
 
enum  { CHANNELID_BA_NUMQUEUEDBUFFERS = 0x0 }
 Channel IDs. More...
 
- Protected Types inherited from Fw::ActiveComponentBase
enum  Lifecycle { CREATED, DISPATCHING, FINALIZING, DONE }
 Tracks the lifecycle of the component. More...
 
- Protected Member Functions inherited from Svc::BufferAccumulatorComponentBase
 BufferAccumulatorComponentBase (const char *compName="")
 Construct BufferAccumulatorComponentBase object. More...
 
virtual ~BufferAccumulatorComponentBase ()
 Destroy BufferAccumulatorComponentBase object. More...
 
bool isConnected_cmdRegOut_OutputPort (FwIndexType portNum)
 
bool isConnected_cmdResponseOut_OutputPort (FwIndexType portNum)
 
bool isConnected_eventOut_OutputPort (FwIndexType portNum)
 
bool isConnected_timeCaller_OutputPort (FwIndexType portNum)
 
bool isConnected_tlmOut_OutputPort (FwIndexType portNum)
 
bool isConnected_bufferSendOutDrain_OutputPort (FwIndexType portNum)
 
bool isConnected_bufferSendOutReturn_OutputPort (FwIndexType portNum)
 
bool isConnected_pingOut_OutputPort (FwIndexType portNum)
 
void bufferSendInFill_handlerBase (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Handler base-class function for input port bufferSendInFill. More...
 
void bufferSendInReturn_handlerBase (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Handler base-class function for input port bufferSendInReturn. More...
 
void pingIn_handlerBase (FwIndexType portNum, U32 key)
 Handler base-class function for input port pingIn. More...
 
virtual void bufferSendInFill_preMsgHook (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Pre-message hook for async input port bufferSendInFill. More...
 
virtual void bufferSendInReturn_preMsgHook (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Pre-message hook for async input port bufferSendInReturn. More...
 
virtual void pingIn_preMsgHook (FwIndexType portNum, U32 key)
 Pre-message hook for async input port pingIn. More...
 
void bufferSendOutDrain_out (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Invoke output port bufferSendOutDrain. More...
 
void bufferSendOutReturn_out (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Invoke output port bufferSendOutReturn. More...
 
void pingOut_out (FwIndexType portNum, U32 key)
 Invoke output port pingOut. More...
 
void cmdResponse_out (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
 Emit command response. More...
 
void BA_SetMode_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void BA_DrainBuffers_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
virtual void BA_SetMode_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command BA_SetMode. More...
 
virtual void BA_DrainBuffers_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command BA_DrainBuffers. More...
 
void log_ACTIVITY_HI_BA_BufferAccepted () const
 
void log_WARNING_HI_BA_QueueFull () const
 
void log_WARNING_HI_BA_StillDraining (U32 numDrained, U32 numToDrain) const
 
void log_WARNING_HI_BA_AlreadyDraining () const
 
void log_WARNING_HI_BA_DrainStalled (U32 numDrained, U32 numToDrain) const
 
void log_ACTIVITY_HI_BA_PartialDrainDone (U32 numDrained) const
 
void log_WARNING_LO_BA_NonBlockDrain (U32 numWillDrain, U32 numReqDrain) const
 
void tlmWrite_BA_NumQueuedBuffers (U32 arg, Fw::Time _tlmTime=Fw::Time()) const
 
Fw::Time getTime () const
 
- Protected Member Functions inherited from Fw::ActiveComponentBase
 ActiveComponentBase (const char *name)
 Constructor. More...
 
virtual ~ActiveComponentBase ()
 Destructor. More...
 
void init (FwEnumStoreType instance)
 initialization code More...
 
virtual void preamble ()
 A function that will be called before the event loop is entered. More...
 
MsgDispatchStatus dispatch ()
 The function that will dispatching messages. More...
 
virtual void finalizer ()
 A function that will be called after exiting the loop. More...
 
- Protected Member Functions inherited from Fw::QueuedComponentBase
 QueuedComponentBase (const char *name)
 Constructor. More...
 
virtual ~QueuedComponentBase ()
 Destructor. More...
 
void init (FwEnumStoreType instance)
 initialization function More...
 
Os::Queue::Status createQueue (FwSizeType depth, FwSizeType msgSize)
 
MsgDispatchStatus dispatchAvailableMessages ()
 dispatches all messages currently in the queue, returning status of the dispatch More...
 
FwSizeType getNumMsgsDropped ()
 return number of messages dropped More...
 
void incNumMsgDropped ()
 increment the number of messages dropped More...
 
- Protected Member Functions inherited from Fw::PassiveComponentBase
 PassiveComponentBase (const char *name)
 Named constructor. More...
 
virtual ~PassiveComponentBase ()
 Destructor. More...
 
void init (FwEnumStoreType instance)
 Initialization function. More...
 
FwEnumStoreType getInstance () const
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor. More...
 
virtual ~ObjBase ()
 Destructor. More...
 
void init ()
 Object initializer. More...
 
- Static Protected Member Functions inherited from Svc::BufferAccumulatorComponentBase
static constexpr FwIndexType getNum_cmdIn_InputPorts ()
 
static constexpr FwIndexType getNum_bufferSendInFill_InputPorts ()
 
static constexpr FwIndexType getNum_bufferSendInReturn_InputPorts ()
 
static constexpr FwIndexType getNum_pingIn_InputPorts ()
 
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts ()
 
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts ()
 
static constexpr FwIndexType getNum_eventOut_OutputPorts ()
 
static constexpr FwIndexType getNum_timeCaller_OutputPorts ()
 
static constexpr FwIndexType getNum_tlmOut_OutputPorts ()
 
static constexpr FwIndexType getNum_bufferSendOutDrain_OutputPorts ()
 
static constexpr FwIndexType getNum_bufferSendOutReturn_OutputPorts ()
 
static constexpr FwIndexType getNum_pingOut_OutputPorts ()
 
- Protected Attributes inherited from Fw::ActiveComponentBase
Os::Task m_task
 task object for active component More...
 
- Protected Attributes inherited from Fw::QueuedComponentBase
Os::Queue m_queue
 queue object for active component More...
 

Detailed Description

Definition at line 34 of file BufferAccumulator.hpp.

Constructor & Destructor Documentation

◆ BufferAccumulator()

Svc::BufferAccumulator::BufferAccumulator ( const char *const  compName)

Construct BufferAccumulator instance

Parameters
compNameThe component name

Definition at line 26 of file BufferAccumulator.cpp.

◆ ~BufferAccumulator()

Svc::BufferAccumulator::~BufferAccumulator ( )

Destroy BufferAccumulator instance

Definition at line 40 of file BufferAccumulator.cpp.

Member Function Documentation

◆ allocateQueue()

void Svc::BufferAccumulator::allocateQueue ( FwEnumStoreType  identifier,
Fw::MemAllocator allocator,
FwSizeType  maxNumBuffers 
)

Give the class a memory buffer. Should be called after constructor and init, but before task is spawned.

Parameters
maxNumBuffersThe maximum number of buffers

Definition at line 46 of file BufferAccumulator.cpp.

◆ deallocateQueue()

void Svc::BufferAccumulator::deallocateQueue ( Fw::MemAllocator allocator)

Return allocated queue. Should be done during shutdown.

Definition at line 60 of file BufferAccumulator.cpp.

Friends And Related Function Documentation

◆ BufferAccumulatorTester

friend class BufferAccumulatorTester
friend

Definition at line 35 of file BufferAccumulator.hpp.

◆ Svc::Accumulate::BufferAccumulatorTester

friend class Svc::Accumulate::BufferAccumulatorTester
friend

Definition at line 36 of file BufferAccumulator.hpp.

◆ Svc::Drain::BufferAccumulatorTester

friend class Svc::Drain::BufferAccumulatorTester
friend

Definition at line 37 of file BufferAccumulator.hpp.

◆ Svc::Errors::BufferAccumulatorTester

friend class Svc::Errors::BufferAccumulatorTester
friend

Definition at line 38 of file BufferAccumulator.hpp.


The documentation for this class was generated from the following files: