11 #if FW_ENABLE_TEXT_LOGGING
33 this->m_bufferGetCallee_InputPort[port].
init();
34 this->m_bufferGetCallee_InputPort[port].
addCallComp(
36 m_p_bufferGetCallee_in
38 this->m_bufferGetCallee_InputPort[port].
setPortNum(port);
40 #if FW_OBJECT_NAMES == 1
55 this->m_bufferGetCallee_InputPort[port].setObjName(portName);
65 this->m_bufferSendIn_InputPort[port].
init();
70 this->m_bufferSendIn_InputPort[port].
setPortNum(port);
72 #if FW_OBJECT_NAMES == 1
87 this->m_bufferSendIn_InputPort[port].setObjName(portName);
97 this->m_schedIn_InputPort[port].
init();
102 this->m_schedIn_InputPort[port].
setPortNum(port);
104 #if FW_OBJECT_NAMES == 1
119 this->m_schedIn_InputPort[port].setObjName(portName);
129 this->m_eventOut_OutputPort[port].
init();
131 #if FW_OBJECT_NAMES == 1
146 this->m_eventOut_OutputPort[port].setObjName(portName);
150 #if FW_ENABLE_TEXT_LOGGING == 1
154 port < static_cast<PlatformIntType>(this->getNum_textEventOut_OutputPorts());
157 this->m_textEventOut_OutputPort[port].
init();
159 #if FW_OBJECT_NAMES == 1
174 this->m_textEventOut_OutputPort[port].setObjName(portName);
185 this->m_timeCaller_OutputPort[port].
init();
187 #if FW_OBJECT_NAMES == 1
202 this->m_timeCaller_OutputPort[port].setObjName(portName);
212 this->m_tlmOut_OutputPort[port].
init();
214 #if FW_OBJECT_NAMES == 1
229 this->m_tlmOut_OutputPort[port].setObjName(portName);
246 return &this->m_bufferGetCallee_InputPort[portNum];
257 return &this->m_bufferSendIn_InputPort[portNum];
268 return &this->m_schedIn_InputPort[portNum];
286 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
289 #if FW_ENABLE_TEXT_LOGGING == 1
291 void BufferManagerComponentBase ::
292 set_textEventOut_OutputPort(
298 portNum < this->getNum_textEventOut_OutputPorts(),
302 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
318 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
332 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
335 #if FW_PORT_SERIALIZATION
344 Fw::InputSerializePort* port
352 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
355 #if FW_ENABLE_TEXT_LOGGING == 1
357 void BufferManagerComponentBase ::
358 set_textEventOut_OutputPort(
360 Fw::InputSerializePort* port
364 portNum < this->getNum_textEventOut_OutputPorts(),
368 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
376 Fw::InputSerializePort* port
384 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
390 Fw::InputSerializePort* port
398 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
409 Fw::PassiveComponentBase(compName)
412 this->m_first_update_TotalBuffs =
true;
413 this->m_last_TotalBuffs = 0;
416 this->m_first_update_CurrBuffs =
true;
417 this->m_last_CurrBuffs = 0;
420 this->m_first_update_HiBuffs =
true;
421 this->m_last_HiBuffs = 0;
424 this->m_first_update_NoBuffs =
true;
425 this->m_last_NoBuffs = 0;
428 this->m_first_update_EmptyBuffs =
true;
429 this->m_last_EmptyBuffs = 0;
431 this->m_NoBuffsAvailableThrottle = 0;
432 this->m_ZeroSizeBufferThrottle = 0;
473 #if FW_ENABLE_TEXT_LOGGING == 1
476 getNum_textEventOut_OutputPorts()
const
507 return this->m_eventOut_OutputPort[portNum].
isConnected();
510 #if FW_ENABLE_TEXT_LOGGING == 1
512 bool BufferManagerComponentBase ::
516 portNum < this->getNum_textEventOut_OutputPorts(),
520 return this->m_textEventOut_OutputPort[portNum].isConnected();
533 return this->m_timeCaller_OutputPort[portNum].
isConnected();
544 return this->m_tlmOut_OutputPort[portNum].
isConnected();
638 this->m_NoBuffsAvailableThrottle++;
643 if (this->m_timeCaller_OutputPort[0].isConnected()) {
644 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
652 if (this->m_eventOut_OutputPort[0].isConnected()) {
656 #if FW_AMPCS_COMPATIBLE
665 #if FW_AMPCS_COMPATIBLE
668 static_cast<U8>(
sizeof(U32))
681 this->m_eventOut_OutputPort[0].
invoke(
690 #if FW_ENABLE_TEXT_LOGGING
691 if (this->m_textEventOut_OutputPort[0].isConnected()) {
692 #if FW_OBJECT_NAMES == 1
693 const char* _formatString =
694 "(%s) %s: No available buffers of size %" PRIu32
"";
696 const char* _formatString =
697 "%s: No available buffers of size %" PRIu32
"";
716 this->m_textEventOut_OutputPort[0].invoke(
734 this->m_ZeroSizeBufferThrottle++;
739 if (this->m_timeCaller_OutputPort[0].isConnected()) {
740 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
748 if (this->m_eventOut_OutputPort[0].isConnected()) {
751 #if FW_AMPCS_COMPATIBLE
761 this->m_eventOut_OutputPort[0].
invoke(
770 #if FW_ENABLE_TEXT_LOGGING
771 if (this->m_textEventOut_OutputPort[0].isConnected()) {
772 #if FW_OBJECT_NAMES == 1
773 const char* _formatString =
774 "(%s) %s: Received zero size buffer";
776 const char* _formatString =
777 "%s: Received zero size buffer";
795 this->m_textEventOut_OutputPort[0].invoke(
813 this->m_NoBuffsAvailableThrottle = 0;
820 this->m_ZeroSizeBufferThrottle = 0;
834 if (not this->m_first_update_TotalBuffs) {
836 if (arg == this->m_last_TotalBuffs) {
840 this->m_last_TotalBuffs = arg;
844 this->m_first_update_TotalBuffs =
false;
845 this->m_last_TotalBuffs = arg;
848 if (this->m_tlmOut_OutputPort[0].isConnected()) {
850 this->m_timeCaller_OutputPort[0].isConnected() &&
853 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
867 this->m_tlmOut_OutputPort[0].
invoke(
882 if (not this->m_first_update_CurrBuffs) {
884 if (arg == this->m_last_CurrBuffs) {
888 this->m_last_CurrBuffs = arg;
892 this->m_first_update_CurrBuffs =
false;
893 this->m_last_CurrBuffs = arg;
896 if (this->m_tlmOut_OutputPort[0].isConnected()) {
898 this->m_timeCaller_OutputPort[0].isConnected() &&
901 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
915 this->m_tlmOut_OutputPort[0].
invoke(
930 if (not this->m_first_update_HiBuffs) {
932 if (arg == this->m_last_HiBuffs) {
936 this->m_last_HiBuffs = arg;
940 this->m_first_update_HiBuffs =
false;
941 this->m_last_HiBuffs = arg;
944 if (this->m_tlmOut_OutputPort[0].isConnected()) {
946 this->m_timeCaller_OutputPort[0].isConnected() &&
949 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
963 this->m_tlmOut_OutputPort[0].
invoke(
978 if (not this->m_first_update_NoBuffs) {
980 if (arg == this->m_last_NoBuffs) {
984 this->m_last_NoBuffs = arg;
988 this->m_first_update_NoBuffs =
false;
989 this->m_last_NoBuffs = arg;
992 if (this->m_tlmOut_OutputPort[0].isConnected()) {
994 this->m_timeCaller_OutputPort[0].isConnected() &&
997 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
1011 this->m_tlmOut_OutputPort[0].
invoke(
1026 if (not this->m_first_update_EmptyBuffs) {
1028 if (arg == this->m_last_EmptyBuffs) {
1032 this->m_last_EmptyBuffs = arg;
1036 this->m_first_update_EmptyBuffs =
false;
1037 this->m_last_EmptyBuffs = arg;
1040 if (this->m_tlmOut_OutputPort[0].isConnected()) {
1042 this->m_timeCaller_OutputPort[0].isConnected() &&
1045 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
1059 this->m_tlmOut_OutputPort[0].
invoke(
1074 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1076 this->m_timeCaller_OutputPort[0].
invoke(_time);
1094 this->m_guardedPortMutex.
lock();
1100 this->m_guardedPortMutex.
unLock();
1108 m_p_bufferGetCallee_in(
1122 void BufferManagerComponentBase ::
1123 m_p_bufferSendIn_in(
1131 compPtr->bufferSendIn_handlerBase(
1137 void BufferManagerComponentBase ::
1146 compPtr->schedIn_handlerBase(
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
PlatformUIntType NATIVE_UINT_TYPE
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
#define FW_OBJ_NAME_MAX_SIZE
Size of object name (if object names enabled). AC Limits to 80, truncation occurs above 80.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
@ WARNING_HI
A serious but recoverable event.
void init()
Object initializer.
void init()
Initialization function.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
void addCallPort(InputTimePort *callPort)
Register an input port.
void invoke(Fw::Time &time)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void unLock()
unlock the mutex
void lock()
lock the mutex
Auto-generated base for BufferManager component.
virtual void unLock()
Unlock the guarded mutex.
bool isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
Fw::InputBufferGetPort * get_bufferGetCallee_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_eventOut_OutputPorts() const
void log_WARNING_HI_ZeroSizeBuffer()
BufferManagerComponentBase(const char *compName="")
Construct BufferManagerComponentBase object.
void tlmWrite_HiBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_timeCaller_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
NATIVE_INT_TYPE getNum_bufferGetCallee_InputPorts() const
NATIVE_INT_TYPE getNum_timeCaller_OutputPorts() const
virtual void schedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)=0
Handler for input port schedIn.
@ EVENTID_NOBUFFSAVAILABLE
The BufferManager was unable to allocate a requested buffer.
@ EVENTID_ZEROSIZEBUFFER
The buffer manager received a zero-sized buffer as a return. Probably undetected empty buffer allocat...
NATIVE_INT_TYPE getNum_tlmOut_OutputPorts() const
@ CHANNELID_TOTALBUFFS
Channel ID for TotalBuffs.
@ CHANNELID_NOBUFFS
Channel ID for NoBuffs.
@ CHANNELID_EMPTYBUFFS
Channel ID for EmptyBuffs.
@ CHANNELID_CURRBUFFS
Channel ID for CurrBuffs.
@ CHANNELID_HIBUFFS
Channel ID for HiBuffs.
void set_tlmOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
NATIVE_INT_TYPE getNum_bufferSendIn_InputPorts() const
NATIVE_INT_TYPE getNum_schedIn_InputPorts() const
void log_WARNING_HI_ZeroSizeBuffer_ThrottleClear()
Reset throttle value for ZeroSizeBuffer.
void log_WARNING_HI_NoBuffsAvailable(U32 size)
void set_eventOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
virtual void bufferSendIn_handler(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferSendIn.
virtual ~BufferManagerComponentBase()
Destroy BufferManagerComponentBase object.
virtual Fw::Buffer bufferGetCallee_handler(NATIVE_INT_TYPE portNum, U32 size)=0
Handler for input port bufferGetCallee.
virtual void lock()
Lock the guarded mutex.
void tlmWrite_EmptyBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_NoBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
Svc::InputSchedPort * get_schedIn_InputPort(NATIVE_INT_TYPE portNum)
void tlmWrite_TotalBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
void tlmWrite_CurrBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void schedIn_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Handler base-class function for input port schedIn.
Fw::Buffer bufferGetCallee_handlerBase(NATIVE_INT_TYPE portNum, U32 size)
Handler base-class function for input port bufferGetCallee.
void log_WARNING_HI_NoBuffsAvailable_ThrottleClear()
Reset throttle value for NoBuffsAvailable.
@ EVENTID_ZEROSIZEBUFFER_THROTTLE
Throttle reset count for ZeroSizeBuffer.
@ EVENTID_NOBUFFSAVAILABLE_THROTTLE
Throttle reset count for NoBuffsAvailable.
bool isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
Fw::InputBufferSendPort * get_bufferSendIn_InputPort(NATIVE_INT_TYPE portNum)
void bufferSendIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferSendIn.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.