F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Svc::ComQueue Class Reference

#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)
 
void init (const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance=0)
 
 ~ComQueue ()
 
void configure (QueueConfigurationTable queueConfig, NATIVE_UINT_TYPE allocationId, Fw::MemAllocator &allocator)
 
void cleanup ()
 
- Public Member Functions inherited from Svc::ComQueueComponentBase
void init (NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance=0)
 Initialize ComQueueComponentBase object.
 
Fw::InputBufferSendPortget_buffQueueIn_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputComPortget_comQueueIn_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputSuccessConditionPortget_comStatusIn_InputPort (NATIVE_INT_TYPE portNum)
 
Svc::InputSchedPortget_run_InputPort (NATIVE_INT_TYPE portNum)
 
void set_Log_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
 Connect port to Log[portNum].
 
void set_Time_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
 Connect port to Time[portNum].
 
void set_Tlm_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
 Connect port to Tlm[portNum].
 
void set_buffQueueSend_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
 Connect port to buffQueueSend[portNum].
 
void set_comQueueSend_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputComPort *port)
 Connect port to comQueueSend[portNum].
 
- Public Member Functions inherited from Fw::ActiveComponentBase
void start (NATIVE_UINT_TYPE priority=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE identifier=Os::Task::TASK_DEFAULT)
 called by instantiator when task is to be started
 
 DEPRECATED (void start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity=-1), "Please switch to start(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier)")
 called by instantiator when task is to be started
 
void exit ()
 exit task in active component
 
Os::Task::TaskStatus join (void **value_ptr)
 provide return value of thread if value_ptr is not NULL
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const U32)
 Set the ID base.
 
U32 getIdBase () const
 

Static Public Attributes

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

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_BUFFQUEUEIN_INPUT_PORTS = 1 , NUM_COMQUEUEIN_INPUT_PORTS = 2 , NUM_COMSTATUSIN_INPUT_PORTS = 1 , NUM_RUN_INPUT_PORTS = 1 }
 Enumerations for numbers of typed input ports. More...
 
enum  { 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_BUFFQUEUESEND_OUTPUT_PORTS = 1 , NUM_COMQUEUESEND_OUTPUT_PORTS = 1 }
 Enumerations for numbers of typed output ports. More...
 
enum  { EVENTID_QUEUEOVERFLOW = 0x0 }
 Event IDs. More...
 
enum  { CHANNELID_COMQUEUEDEPTH = 0x0 , CHANNELID_BUFFQUEUEDEPTH = 0x1 }
 Channel IDs. More...
 
- Protected Member Functions inherited from Svc::ComQueueComponentBase
 ComQueueComponentBase (const char *compName="")
 Construct ComQueueComponentBase object.
 
virtual ~ComQueueComponentBase ()
 Destroy ComQueueComponentBase object.
 
NATIVE_INT_TYPE getNum_buffQueueIn_InputPorts () const
 
NATIVE_INT_TYPE getNum_comQueueIn_InputPorts () const
 
NATIVE_INT_TYPE getNum_comStatusIn_InputPorts () const
 
NATIVE_INT_TYPE getNum_run_InputPorts () const
 
NATIVE_INT_TYPE getNum_Log_OutputPorts () const
 
NATIVE_INT_TYPE getNum_Time_OutputPorts () const
 
NATIVE_INT_TYPE getNum_Tlm_OutputPorts () const
 
NATIVE_INT_TYPE getNum_buffQueueSend_OutputPorts () const
 
NATIVE_INT_TYPE getNum_comQueueSend_OutputPorts () const
 
bool isConnected_Log_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Time_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Tlm_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_buffQueueSend_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_comQueueSend_OutputPort (NATIVE_INT_TYPE portNum)
 
void buffQueueIn_handlerBase (NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
 Handler base-class function for input port buffQueueIn.
 
void comQueueIn_handlerBase (NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
 Handler base-class function for input port comQueueIn.
 
void comStatusIn_handlerBase (NATIVE_INT_TYPE portNum, Fw::Success &condition)
 Handler base-class function for input port comStatusIn.
 
void run_handlerBase (NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
 Handler base-class function for input port run.
 
virtual void buffQueueIn_preMsgHook (NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
 Pre-message hook for async input port buffQueueIn.
 
virtual void comQueueIn_preMsgHook (NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
 Pre-message hook for async input port comQueueIn.
 
virtual void comStatusIn_preMsgHook (NATIVE_INT_TYPE portNum, Fw::Success &condition)
 Pre-message hook for async input port comStatusIn.
 
virtual void run_preMsgHook (NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
 Pre-message hook for async input port run.
 
void buffQueueSend_out (NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
 Invoke output port buffQueueSend.
 
void comQueueSend_out (NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
 Invoke output port comQueueSend.
 
void log_WARNING_HI_QueueOverflow (Svc::QueueType queueType, U32 index)
 
void tlmWrite_comQueueDepth (const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
 
void tlmWrite_buffQueueDepth (const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
 
Fw::Time getTime ()
 
- Protected Member Functions inherited from Fw::ActiveComponentBase
 ActiveComponentBase (const char *name)
 Constructor.
 
virtual ~ActiveComponentBase ()
 Destructor.
 
void init (NATIVE_INT_TYPE instance)
 initialization code
 
virtual void preamble ()
 A function that will be called before the event loop is entered.
 
virtual void loop ()
 The function that will loop dispatching messages.
 
virtual void finalizer ()
 A function that will be called after exiting the loop.
 
- Protected Member Functions inherited from Fw::QueuedComponentBase
 QueuedComponentBase (const char *name)
 Constructor.
 
virtual ~QueuedComponentBase ()
 Destructor.
 
void init (NATIVE_INT_TYPE instance)
 initialization function
 
Os::Queue::QueueStatus createQueue (NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
 
NATIVE_INT_TYPE getNumMsgsDropped ()
 return number of messages dropped
 
void incNumMsgDropped ()
 increment the number of messages dropped
 
- Protected Member Functions inherited from Fw::PassiveComponentBase
 PassiveComponentBase (const char *name)
 Named constructor.
 
virtual ~PassiveComponentBase ()
 Destructor.
 
void init (NATIVE_INT_TYPE instance)
 Initialization function.
 
NATIVE_INT_TYPE getInstance () const
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor.
 
virtual ~ObjBase ()
 Destructor.
 
void init ()
 Object initializer.
 
- Protected Attributes inherited from Fw::ActiveComponentBase
Os::Task m_task
 task object for active component
 
- Protected Attributes inherited from Fw::QueuedComponentBase
Os::Queue m_queue
 queue object for active component
 

Detailed Description

Definition at line 23 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 24 of file ComQueue.cpp.

◆ ~ComQueue()

Svc::ComQueue::~ComQueue ( )

Destroy object ComQueue

Definition at line 36 of file ComQueue.cpp.

Member Function Documentation

◆ cleanup()

void Svc::ComQueue::cleanup ( )

Deallocate resources and cleanup ComQueue

Definition at line 42 of file ComQueue.cpp.

◆ configure()

void Svc::ComQueue::configure ( QueueConfigurationTable queueConfig,
NATIVE_UINT_TYPE 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 49 of file ComQueue.cpp.

◆ init()

void Svc::ComQueue::init ( const NATIVE_INT_TYPE queueDepth,
const NATIVE_INT_TYPE instance = 0 )

Initialize object ComQueue

Parameters
queueDepthThe queue depth
instanceThe instance number

Definition at line 38 of file ComQueue.cpp.

Member Data Documentation

◆ BUFFER_PORT_COUNT

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

Total count of input buffer ports and thus total queues.

Definition at line 29 of file ComQueue.hpp.

◆ COM_PORT_COUNT

const FwIndexType Svc::ComQueue::COM_PORT_COUNT = ComQueueComponentBase::NUM_COMQUEUEIN_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 26 of file ComQueue.hpp.

◆ TOTAL_PORT_COUNT

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

Definition at line 32 of file ComQueue.hpp.


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