10#if FW_ENABLE_TEXT_LOGGING
20 void BufferManagerComponentBase ::
29 port < static_cast<FwIndexType>(this->getNum_bufferGetCallee_InputPorts());
32 this->m_bufferGetCallee_InputPort[port].init();
33 this->m_bufferGetCallee_InputPort[port].addCallComp(
35 m_p_bufferGetCallee_in
37 this->m_bufferGetCallee_InputPort[port].setPortNum(port);
39#if FW_OBJECT_NAMES == 1
43 this->m_objName.toChar(),
46 this->m_bufferGetCallee_InputPort[port].setObjName(portName.
toChar());
53 port < static_cast<FwIndexType>(this->getNum_bufferSendIn_InputPorts());
56 this->m_bufferSendIn_InputPort[port].init();
57 this->m_bufferSendIn_InputPort[port].addCallComp(
61 this->m_bufferSendIn_InputPort[port].setPortNum(port);
63#if FW_OBJECT_NAMES == 1
67 this->m_objName.toChar(),
70 this->m_bufferSendIn_InputPort[port].setObjName(portName.
toChar());
77 port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
80 this->m_schedIn_InputPort[port].init();
81 this->m_schedIn_InputPort[port].addCallComp(
85 this->m_schedIn_InputPort[port].setPortNum(port);
87#if FW_OBJECT_NAMES == 1
91 this->m_objName.toChar(),
94 this->m_schedIn_InputPort[port].setObjName(portName.
toChar());
101 port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
104 this->m_eventOut_OutputPort[port].init();
106#if FW_OBJECT_NAMES == 1
110 this->m_objName.toChar(),
113 this->m_eventOut_OutputPort[port].setObjName(portName.
toChar());
117#if FW_ENABLE_TEXT_LOGGING == 1
121 port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
124 this->m_textEventOut_OutputPort[port].init();
126#if FW_OBJECT_NAMES == 1
130 this->m_objName.toChar(),
133 this->m_textEventOut_OutputPort[port].setObjName(portName.
toChar());
141 port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
144 this->m_timeCaller_OutputPort[port].init();
146#if FW_OBJECT_NAMES == 1
150 this->m_objName.toChar(),
153 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
160 port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
163 this->m_tlmOut_OutputPort[port].init();
165#if FW_OBJECT_NAMES == 1
169 this->m_objName.toChar(),
172 this->m_tlmOut_OutputPort[port].setObjName(portName.
toChar());
185 portNum < this->getNum_bufferGetCallee_InputPorts(),
189 return &this->m_bufferGetCallee_InputPort[portNum];
196 portNum < this->getNum_bufferSendIn_InputPorts(),
200 return &this->m_bufferSendIn_InputPort[portNum];
207 portNum < this->getNum_schedIn_InputPorts(),
211 return &this->m_schedIn_InputPort[portNum];
218 void BufferManagerComponentBase ::
219 set_eventOut_OutputPort(
225 portNum < this->getNum_eventOut_OutputPorts(),
229 this->m_eventOut_OutputPort[portNum].addCallPort(port);
232#if FW_ENABLE_TEXT_LOGGING == 1
234 void BufferManagerComponentBase ::
235 set_textEventOut_OutputPort(
241 portNum < this->getNum_textEventOut_OutputPorts(),
245 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
250 void BufferManagerComponentBase ::
251 set_timeCaller_OutputPort(
257 portNum < this->getNum_timeCaller_OutputPorts(),
261 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
264 void BufferManagerComponentBase ::
265 set_tlmOut_OutputPort(
271 portNum < this->getNum_tlmOut_OutputPorts(),
275 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
278#if FW_PORT_SERIALIZATION
284 void BufferManagerComponentBase ::
285 set_eventOut_OutputPort(
287 Fw::InputSerializePort* port
291 portNum < this->getNum_eventOut_OutputPorts(),
295 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
298#if FW_ENABLE_TEXT_LOGGING == 1
300 void BufferManagerComponentBase ::
301 set_textEventOut_OutputPort(
303 Fw::InputSerializePort* port
307 portNum < this->getNum_textEventOut_OutputPorts(),
311 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
316 void BufferManagerComponentBase ::
317 set_timeCaller_OutputPort(
319 Fw::InputSerializePort* port
323 portNum < this->getNum_timeCaller_OutputPorts(),
327 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
330 void BufferManagerComponentBase ::
331 set_tlmOut_OutputPort(
333 Fw::InputSerializePort* port
337 portNum < this->getNum_tlmOut_OutputPorts(),
341 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
350 BufferManagerComponentBase ::
351 BufferManagerComponentBase(
const char* compName) :
352 Fw::PassiveComponentBase(compName)
355 this->m_first_update_TotalBuffs =
true;
356 this->m_last_TotalBuffs = 0;
359 this->m_first_update_CurrBuffs =
true;
360 this->m_last_CurrBuffs = 0;
363 this->m_first_update_HiBuffs =
true;
364 this->m_last_HiBuffs = 0;
367 this->m_first_update_NoBuffs =
true;
368 this->m_last_NoBuffs = 0;
371 this->m_first_update_EmptyBuffs =
true;
372 this->m_last_EmptyBuffs = 0;
374 this->m_NoBuffsAvailableThrottle = 0;
375 this->m_ZeroSizeBufferThrottle = 0;
378 BufferManagerComponentBase ::
379 ~BufferManagerComponentBase()
389 getNum_bufferGetCallee_InputPorts()
const
395 getNum_bufferSendIn_InputPorts()
const
401 getNum_schedIn_InputPorts()
const
411 getNum_eventOut_OutputPorts()
const
416#if FW_ENABLE_TEXT_LOGGING == 1
419 getNum_textEventOut_OutputPorts()
const
427 getNum_timeCaller_OutputPorts()
const
433 getNum_tlmOut_OutputPorts()
const
442 bool BufferManagerComponentBase ::
443 isConnected_eventOut_OutputPort(
FwIndexType portNum)
446 portNum < this->getNum_eventOut_OutputPorts(),
450 return this->m_eventOut_OutputPort[portNum].isConnected();
453#if FW_ENABLE_TEXT_LOGGING == 1
455 bool BufferManagerComponentBase ::
456 isConnected_textEventOut_OutputPort(
FwIndexType portNum)
459 portNum < this->getNum_textEventOut_OutputPorts(),
463 return this->m_textEventOut_OutputPort[portNum].isConnected();
468 bool BufferManagerComponentBase ::
469 isConnected_timeCaller_OutputPort(
FwIndexType portNum)
472 portNum < this->getNum_timeCaller_OutputPorts(),
476 return this->m_timeCaller_OutputPort[portNum].isConnected();
479 bool BufferManagerComponentBase ::
483 portNum < this->getNum_tlmOut_OutputPorts(),
487 return this->m_tlmOut_OutputPort[portNum].isConnected();
497 bufferGetCallee_handlerBase(
504 portNum < this->getNum_bufferGetCallee_InputPorts(),
514 retVal = this->bufferGetCallee_handler(
525 void BufferManagerComponentBase ::
526 bufferSendIn_handlerBase(
533 portNum < this->getNum_bufferSendIn_InputPorts(),
541 this->bufferSendIn_handler(
550 void BufferManagerComponentBase ::
558 portNum < this->getNum_schedIn_InputPorts(),
563 this->schedIn_handler(
573 void BufferManagerComponentBase ::
574 log_WARNING_HI_NoBuffsAvailable(U32 size)
577 if (this->m_NoBuffsAvailableThrottle >= EVENTID_NOBUFFSAVAILABLE_THROTTLE) {
581 this->m_NoBuffsAvailableThrottle++;
586 if (this->m_timeCaller_OutputPort[0].isConnected()) {
587 this->m_timeCaller_OutputPort[0].invoke(_logTime);
592 _id = this->getIdBase() + EVENTID_NOBUFFSAVAILABLE;
595 if (this->m_eventOut_OutputPort[0].isConnected()) {
599#if FW_AMPCS_COMPATIBLE
608#if FW_AMPCS_COMPATIBLE
611 static_cast<U8>(
sizeof(U32))
624 this->m_eventOut_OutputPort[0].invoke(
633#if FW_ENABLE_TEXT_LOGGING
634 if (this->m_textEventOut_OutputPort[0].isConnected()) {
635#if FW_OBJECT_NAMES == 1
636 const char* _formatString =
637 "(%s) %s: No available buffers of size %" PRIu32
"";
639 const char* _formatString =
640 "%s: No available buffers of size %" PRIu32
"";
647 this->m_objName.toChar(),
653 this->m_textEventOut_OutputPort[0].invoke(
663 void BufferManagerComponentBase ::
664 log_WARNING_HI_ZeroSizeBuffer()
667 if (this->m_ZeroSizeBufferThrottle >= EVENTID_ZEROSIZEBUFFER_THROTTLE) {
671 this->m_ZeroSizeBufferThrottle++;
676 if (this->m_timeCaller_OutputPort[0].isConnected()) {
677 this->m_timeCaller_OutputPort[0].invoke(_logTime);
682 _id = this->getIdBase() + EVENTID_ZEROSIZEBUFFER;
685 if (this->m_eventOut_OutputPort[0].isConnected()) {
688#if FW_AMPCS_COMPATIBLE
698 this->m_eventOut_OutputPort[0].invoke(
707#if FW_ENABLE_TEXT_LOGGING
708 if (this->m_textEventOut_OutputPort[0].isConnected()) {
709#if FW_OBJECT_NAMES == 1
710 const char* _formatString =
711 "(%s) %s: Received zero size buffer";
713 const char* _formatString =
714 "%s: Received zero size buffer";
721 this->m_objName.toChar(),
726 this->m_textEventOut_OutputPort[0].invoke(
740 void BufferManagerComponentBase ::
741 log_WARNING_HI_NoBuffsAvailable_ThrottleClear()
744 this->m_NoBuffsAvailableThrottle = 0;
747 void BufferManagerComponentBase ::
748 log_WARNING_HI_ZeroSizeBuffer_ThrottleClear()
751 this->m_ZeroSizeBufferThrottle = 0;
758 void BufferManagerComponentBase ::
765 if (not this->m_first_update_TotalBuffs) {
767 if (arg == this->m_last_TotalBuffs) {
771 this->m_last_TotalBuffs = arg;
775 this->m_first_update_TotalBuffs =
false;
776 this->m_last_TotalBuffs = arg;
779 if (this->m_tlmOut_OutputPort[0].isConnected()) {
781 this->m_timeCaller_OutputPort[0].isConnected() &&
784 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
796 _id = this->getIdBase() + CHANNELID_TOTALBUFFS;
798 this->m_tlmOut_OutputPort[0].invoke(
806 void BufferManagerComponentBase ::
813 if (not this->m_first_update_CurrBuffs) {
815 if (arg == this->m_last_CurrBuffs) {
819 this->m_last_CurrBuffs = arg;
823 this->m_first_update_CurrBuffs =
false;
824 this->m_last_CurrBuffs = arg;
827 if (this->m_tlmOut_OutputPort[0].isConnected()) {
829 this->m_timeCaller_OutputPort[0].isConnected() &&
832 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
844 _id = this->getIdBase() + CHANNELID_CURRBUFFS;
846 this->m_tlmOut_OutputPort[0].invoke(
854 void BufferManagerComponentBase ::
861 if (not this->m_first_update_HiBuffs) {
863 if (arg == this->m_last_HiBuffs) {
867 this->m_last_HiBuffs = arg;
871 this->m_first_update_HiBuffs =
false;
872 this->m_last_HiBuffs = arg;
875 if (this->m_tlmOut_OutputPort[0].isConnected()) {
877 this->m_timeCaller_OutputPort[0].isConnected() &&
880 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
892 _id = this->getIdBase() + CHANNELID_HIBUFFS;
894 this->m_tlmOut_OutputPort[0].invoke(
902 void BufferManagerComponentBase ::
909 if (not this->m_first_update_NoBuffs) {
911 if (arg == this->m_last_NoBuffs) {
915 this->m_last_NoBuffs = arg;
919 this->m_first_update_NoBuffs =
false;
920 this->m_last_NoBuffs = arg;
923 if (this->m_tlmOut_OutputPort[0].isConnected()) {
925 this->m_timeCaller_OutputPort[0].isConnected() &&
928 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
940 _id = this->getIdBase() + CHANNELID_NOBUFFS;
942 this->m_tlmOut_OutputPort[0].invoke(
950 void BufferManagerComponentBase ::
957 if (not this->m_first_update_EmptyBuffs) {
959 if (arg == this->m_last_EmptyBuffs) {
963 this->m_last_EmptyBuffs = arg;
967 this->m_first_update_EmptyBuffs =
false;
968 this->m_last_EmptyBuffs = arg;
971 if (this->m_tlmOut_OutputPort[0].isConnected()) {
973 this->m_timeCaller_OutputPort[0].isConnected() &&
976 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
988 _id = this->getIdBase() + CHANNELID_EMPTYBUFFS;
990 this->m_tlmOut_OutputPort[0].invoke(
1005 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1007 this->m_timeCaller_OutputPort[0].invoke(_time);
1022 void BufferManagerComponentBase ::
1025 this->m_guardedPortMutex.lock();
1028 void BufferManagerComponentBase ::
1031 this->m_guardedPortMutex.unLock();
1039 m_p_bufferGetCallee_in(
1053 void BufferManagerComponentBase ::
1054 m_p_bufferSendIn_in(
1061 BufferManagerComponentBase* compPtr =
static_cast<BufferManagerComponentBase*
>(callComp);
1068 void BufferManagerComponentBase ::
1076 BufferManagerComponentBase* compPtr =
static_cast<BufferManagerComponentBase*
>(callComp);
1077 compPtr->schedIn_handlerBase(
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)/*#en...
@ WARNING_HI
A serious but recoverable event.
void init()
Object initializer.
const char * toChar() const
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
Auto-generated base for BufferManager component.
Fw::Buffer bufferGetCallee_handlerBase(FwIndexType portNum, U32 size)
Handler base-class function for input port bufferGetCallee.
void bufferSendIn_handlerBase(FwIndexType 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.