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

#include <Svc/ComQueue/ComQueue.hpp>

Inheritance diagram for Svc::ComQueue:
Svc::ComQueueComponentBase Fw::ActiveComponentBase Fw::QueuedComponentBase Fw::PassiveComponentBase Fw::ObjBase

Classes

struct  QueueConfigurationEntry
 configuration data for each queue More...
 
struct  QueueConfigurationTable
 configuration table for each queue More...
 

Public Member Functions

 ComQueue (const char *const compName)
 
 ~ComQueue ()
 
void configure (QueueConfigurationTable queueConfig, FwEnumStoreType allocationId, Fw::MemAllocator &allocator)
 
void cleanup ()
 
- Public Member Functions inherited from Svc::ComQueueComponentBase
void init (FwSizeType queueDepth, FwEnumStoreType instance=0)
 Initialize ComQueueComponentBase object. More...
 
Fw::InputCmdPortget_CmdDisp_InputPort (FwIndexType portNum)
 
Fw::InputBufferSendPortget_bufferQueueIn_InputPort (FwIndexType portNum)
 
Fw::InputComPortget_comPacketQueueIn_InputPort (FwIndexType portNum)
 
Fw::InputSuccessConditionPortget_comStatusIn_InputPort (FwIndexType portNum)
 
Svc::InputComDataWithContextPortget_dataReturnIn_InputPort (FwIndexType portNum)
 
Svc::InputSchedPortget_run_InputPort (FwIndexType portNum)
 
void set_CmdReg_OutputPort (FwIndexType portNum, Fw::InputCmdRegPort *port)
 Connect port to CmdReg[portNum]. More...
 
void set_CmdStatus_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port)
 Connect port to CmdStatus[portNum]. More...
 
void set_Log_OutputPort (FwIndexType portNum, Fw::InputLogPort *port)
 Connect port to Log[portNum]. More...
 
void set_Time_OutputPort (FwIndexType portNum, Fw::InputTimePort *port)
 Connect port to Time[portNum]. More...
 
void set_Tlm_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port)
 Connect port to Tlm[portNum]. More...
 
void set_bufferReturnOut_OutputPort (FwIndexType portNum, Fw::InputBufferSendPort *port)
 Connect port to bufferReturnOut[portNum]. More...
 
void set_dataOut_OutputPort (FwIndexType portNum, Svc::InputComDataWithContextPort *port)
 Connect port to dataOut[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
 

Static Public Attributes

static const FwIndexType COM_PORT_COUNT = ComQueueComponentBase::NUM_COMPACKETQUEUEIN_INPUT_PORTS
 < Count of Fw::Com input ports and thus Fw::Com queues More...
 
static const FwIndexType BUFFER_PORT_COUNT = ComQueueComponentBase::NUM_BUFFERQUEUEIN_INPUT_PORTS
 
static const FwIndexType TOTAL_PORT_COUNT = COM_PORT_COUNT + BUFFER_PORT_COUNT
 Total count of input buffer ports and thus total queues. More...
 

Friends

class ComQueueTester
 

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::ComQueueComponentBase
enum  { NUM_CMDDISP_INPUT_PORTS = 1 }
 Enumerations for numbers of special input ports. More...
 
enum  {
  NUM_BUFFERQUEUEIN_INPUT_PORTS = 1, NUM_COMPACKETQUEUEIN_INPUT_PORTS = 2, NUM_COMSTATUSIN_INPUT_PORTS = 1, NUM_DATARETURNIN_INPUT_PORTS = 1,
  NUM_RUN_INPUT_PORTS = 1
}
 Enumerations for numbers of typed input ports. More...
 
enum  {
  NUM_CMDREG_OUTPUT_PORTS = 1, NUM_CMDSTATUS_OUTPUT_PORTS = 1, NUM_LOG_OUTPUT_PORTS = 1, NUM_LOGTEXT_OUTPUT_PORTS = 1,
  NUM_TIME_OUTPUT_PORTS = 1, NUM_TLM_OUTPUT_PORTS = 1
}
 Enumerations for numbers of special output ports. More...
 
enum  { NUM_BUFFERRETURNOUT_OUTPUT_PORTS = 1, NUM_DATAOUT_OUTPUT_PORTS = 1 }
 Enumerations for numbers of typed output ports. More...
 
enum  { OPCODE_FLUSH_QUEUE = 0x0, OPCODE_FLUSH_ALL_QUEUES = 0x1, OPCODE_SET_QUEUE_PRIORITY = 0x2 }
 Command opcodes. More...
 
enum  { EVENTID_QUEUEOVERFLOW = 0x0, EVENTID_QUEUEPRIORITYCHANGED = 0x1 }
 Event IDs. More...
 
enum  { CHANNELID_COMQUEUEDEPTH = 0x0, CHANNELID_BUFFQUEUEDEPTH = 0x1 }
 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::ComQueueComponentBase
 ComQueueComponentBase (const char *compName="")
 Construct ComQueueComponentBase object. More...
 
virtual ~ComQueueComponentBase ()
 Destroy ComQueueComponentBase object. More...
 
bool isConnected_CmdReg_OutputPort (FwIndexType portNum)
 
bool isConnected_CmdStatus_OutputPort (FwIndexType portNum)
 
bool isConnected_Log_OutputPort (FwIndexType portNum)
 
bool isConnected_Time_OutputPort (FwIndexType portNum)
 
bool isConnected_Tlm_OutputPort (FwIndexType portNum)
 
bool isConnected_bufferReturnOut_OutputPort (FwIndexType portNum)
 
bool isConnected_dataOut_OutputPort (FwIndexType portNum)
 
void bufferQueueIn_handlerBase (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Handler base-class function for input port bufferQueueIn. More...
 
void comPacketQueueIn_handlerBase (FwIndexType portNum, Fw::ComBuffer &data, U32 context)
 Handler base-class function for input port comPacketQueueIn. More...
 
void comStatusIn_handlerBase (FwIndexType portNum, Fw::Success &condition)
 Handler base-class function for input port comStatusIn. More...
 
void dataReturnIn_handlerBase (FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
 Handler base-class function for input port dataReturnIn. More...
 
void run_handlerBase (FwIndexType portNum, U32 context)
 Handler base-class function for input port run. More...
 
virtual void bufferQueueIn_preMsgHook (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Pre-message hook for async input port bufferQueueIn. More...
 
virtual void comPacketQueueIn_preMsgHook (FwIndexType portNum, Fw::ComBuffer &data, U32 context)
 Pre-message hook for async input port comPacketQueueIn. More...
 
virtual void comStatusIn_preMsgHook (FwIndexType portNum, Fw::Success &condition)
 Pre-message hook for async input port comStatusIn. More...
 
virtual void run_preMsgHook (FwIndexType portNum, U32 context)
 Pre-message hook for async input port run. More...
 
void bufferReturnOut_out (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Invoke output port bufferReturnOut. More...
 
void dataOut_out (FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
 Invoke output port dataOut. More...
 
void cmdResponse_out (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
 Emit command response. More...
 
void FLUSH_QUEUE_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void FLUSH_ALL_QUEUES_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void SET_QUEUE_PRIORITY_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
virtual void FLUSH_QUEUE_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command FLUSH_QUEUE. More...
 
virtual void FLUSH_ALL_QUEUES_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command FLUSH_ALL_QUEUES. More...
 
virtual void SET_QUEUE_PRIORITY_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command SET_QUEUE_PRIORITY. More...
 
void log_WARNING_HI_QueueOverflow (Svc::QueueType queueType, FwIndexType index) const
 
void log_ACTIVITY_HI_QueuePriorityChanged (Svc::QueueType queueType, FwIndexType indexType, FwIndexType newPriority) const
 
void tlmWrite_comQueueDepth (const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
 
void tlmWrite_buffQueueDepth (const Svc::BuffQueueDepth &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::ComQueueComponentBase
static constexpr FwIndexType getNum_CmdDisp_InputPorts ()
 
static constexpr FwIndexType getNum_bufferQueueIn_InputPorts ()
 
static constexpr FwIndexType getNum_comPacketQueueIn_InputPorts ()
 
static constexpr FwIndexType getNum_comStatusIn_InputPorts ()
 
static constexpr FwIndexType getNum_dataReturnIn_InputPorts ()
 
static constexpr FwIndexType getNum_run_InputPorts ()
 
static constexpr FwIndexType getNum_CmdReg_OutputPorts ()
 
static constexpr FwIndexType getNum_CmdStatus_OutputPorts ()
 
static constexpr FwIndexType getNum_Log_OutputPorts ()
 
static constexpr FwIndexType getNum_Time_OutputPorts ()
 
static constexpr FwIndexType getNum_Tlm_OutputPorts ()
 
static constexpr FwIndexType getNum_bufferReturnOut_OutputPorts ()
 
static constexpr FwIndexType getNum_dataOut_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 24 of file ComQueue.hpp.

Constructor & Destructor Documentation

◆ ComQueue()

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

Construct object ComQueue

Parameters
compNameThe component name

Definition at line 33 of file ComQueue.cpp.

◆ ~ComQueue()

Svc::ComQueue::~ComQueue ( )

Destroy object ComQueue

Definition at line 48 of file ComQueue.cpp.

Member Function Documentation

◆ cleanup()

void Svc::ComQueue::cleanup ( )

Deallocate resources and cleanup ComQueue

Definition at line 50 of file ComQueue.cpp.

◆ configure()

void Svc::ComQueue::configure ( QueueConfigurationTable  queueConfig,
FwEnumStoreType  allocationId,
Fw::MemAllocator allocator 
)

Configure the queue depths, priorities, and memory allocation for the component

Takes in the queue depth and priority per-port in order from Fw::Com through Fw::Buffer ports. Calculates the queue metadata stored m_prioritizedList and then sorts that list by priority.

Parameters
queueConfigTable of the configuration properties for the component
allocationIdIdentifier used when dealing with the Fw::MemAllocator
allocatorFw::MemAllocator used to acquire memory

Definition at line 57 of file ComQueue.cpp.

Friends And Related Function Documentation

◆ ComQueueTester

friend class ComQueueTester
friend

Definition at line 26 of file ComQueue.hpp.

Member Data Documentation

◆ BUFFER_PORT_COUNT

const FwIndexType Svc::ComQueue::BUFFER_PORT_COUNT = ComQueueComponentBase::NUM_BUFFERQUEUEIN_INPUT_PORTS
static

Definition at line 36 of file ComQueue.hpp.

◆ COM_PORT_COUNT

const FwIndexType Svc::ComQueue::COM_PORT_COUNT = ComQueueComponentBase::NUM_COMPACKETQUEUEIN_INPUT_PORTS
static

< Count of Fw::Com input ports and thus Fw::Com queues

Count of Fw::Buffer input ports and thus Fw::Buffer queues

Definition at line 33 of file ComQueue.hpp.

◆ TOTAL_PORT_COUNT

const FwIndexType Svc::ComQueue::TOTAL_PORT_COUNT = COM_PORT_COUNT + BUFFER_PORT_COUNT
static

Total count of input buffer ports and thus total queues.

Definition at line 41 of file ComQueue.hpp.


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