11#if FW_ENABLE_TEXT_LOGGING
27 class ComponentIpcSerializableBuffer :
42 return sizeof(m_buff);
49 const U8* getBuffAddr()
const {
55 U8 m_buff[SERIALIZATION_SIZE];
64 void BufferManagerComponentBase ::
73 port < static_cast<PlatformIntType>(this->getNum_bufferGetCallee_InputPorts());
76 this->m_bufferGetCallee_InputPort[port].init();
77 this->m_bufferGetCallee_InputPort[port].addCallComp(
79 m_p_bufferGetCallee_in
81 this->m_bufferGetCallee_InputPort[port].setPortNum(port);
83#if FW_OBJECT_NAMES == 1
92 this->m_bufferGetCallee_InputPort[port].setObjName(portName);
99 port < static_cast<PlatformIntType>(this->getNum_bufferSendIn_InputPorts());
102 this->m_bufferSendIn_InputPort[port].init();
103 this->m_bufferSendIn_InputPort[port].addCallComp(
107 this->m_bufferSendIn_InputPort[port].setPortNum(port);
109#if FW_OBJECT_NAMES == 1
118 this->m_bufferSendIn_InputPort[port].setObjName(portName);
125 port < static_cast<PlatformIntType>(this->getNum_schedIn_InputPorts());
128 this->m_schedIn_InputPort[port].init();
129 this->m_schedIn_InputPort[port].addCallComp(
133 this->m_schedIn_InputPort[port].setPortNum(port);
135#if FW_OBJECT_NAMES == 1
144 this->m_schedIn_InputPort[port].setObjName(portName);
151 port < static_cast<PlatformIntType>(this->getNum_eventOut_OutputPorts());
154 this->m_eventOut_OutputPort[port].init();
156#if FW_OBJECT_NAMES == 1
165 this->m_eventOut_OutputPort[port].setObjName(portName);
169#if FW_ENABLE_TEXT_LOGGING == 1
173 port < static_cast<PlatformIntType>(this->getNum_textEventOut_OutputPorts());
176 this->m_textEventOut_OutputPort[port].init();
178#if FW_OBJECT_NAMES == 1
187 this->m_textEventOut_OutputPort[port].setObjName(portName);
195 port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
198 this->m_timeCaller_OutputPort[port].init();
200#if FW_OBJECT_NAMES == 1
209 this->m_timeCaller_OutputPort[port].setObjName(portName);
216 port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
219 this->m_tlmOut_OutputPort[port].init();
221#if FW_OBJECT_NAMES == 1
230 this->m_tlmOut_OutputPort[port].setObjName(portName);
64 void BufferManagerComponentBase :: {
…}
243 portNum < this->getNum_bufferGetCallee_InputPorts(),
247 return &this->m_bufferGetCallee_InputPort[portNum];
254 portNum < this->getNum_bufferSendIn_InputPorts(),
258 return &this->m_bufferSendIn_InputPort[portNum];
265 portNum < this->getNum_schedIn_InputPorts(),
269 return &this->m_schedIn_InputPort[portNum];
276 void BufferManagerComponentBase ::
277 set_eventOut_OutputPort(
283 portNum < this->getNum_eventOut_OutputPorts(),
287 this->m_eventOut_OutputPort[portNum].addCallPort(port);
276 void BufferManagerComponentBase :: {
…}
290#if FW_ENABLE_TEXT_LOGGING == 1
292 void BufferManagerComponentBase ::
293 set_textEventOut_OutputPort(
299 portNum < this->getNum_textEventOut_OutputPorts(),
303 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
308 void BufferManagerComponentBase ::
309 set_timeCaller_OutputPort(
315 portNum < this->getNum_timeCaller_OutputPorts(),
319 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
308 void BufferManagerComponentBase :: {
…}
322 void BufferManagerComponentBase ::
323 set_tlmOut_OutputPort(
329 portNum < this->getNum_tlmOut_OutputPorts(),
333 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
322 void BufferManagerComponentBase :: {
…}
336#if FW_PORT_SERIALIZATION
342 void BufferManagerComponentBase ::
343 set_eventOut_OutputPort(
345 Fw::InputSerializePort* port
349 portNum < this->getNum_eventOut_OutputPorts(),
353 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
356#if FW_ENABLE_TEXT_LOGGING == 1
358 void BufferManagerComponentBase ::
359 set_textEventOut_OutputPort(
361 Fw::InputSerializePort* port
365 portNum < this->getNum_textEventOut_OutputPorts(),
369 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
374 void BufferManagerComponentBase ::
375 set_timeCaller_OutputPort(
377 Fw::InputSerializePort* port
381 portNum < this->getNum_timeCaller_OutputPorts(),
385 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
388 void BufferManagerComponentBase ::
389 set_tlmOut_OutputPort(
391 Fw::InputSerializePort* port
395 portNum < this->getNum_tlmOut_OutputPorts(),
399 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
408 BufferManagerComponentBase ::
409 BufferManagerComponentBase(
const char* compName) :
410 Fw::PassiveComponentBase(compName)
413 this->m_first_update_TotalBuffs =
true;
414 this->m_last_TotalBuffs = 0;
417 this->m_first_update_CurrBuffs =
true;
418 this->m_last_CurrBuffs = 0;
421 this->m_first_update_HiBuffs =
true;
422 this->m_last_HiBuffs = 0;
425 this->m_first_update_NoBuffs =
true;
426 this->m_last_NoBuffs = 0;
429 this->m_first_update_EmptyBuffs =
true;
430 this->m_last_EmptyBuffs = 0;
432 this->m_NoBuffsAvailableThrottle = 0;
433 this->m_ZeroSizeBufferThrottle = 0;
408 BufferManagerComponentBase :: {
…}
436 BufferManagerComponentBase ::
437 ~BufferManagerComponentBase()
436 BufferManagerComponentBase :: {
…}
447 getNum_bufferGetCallee_InputPorts()
453 getNum_bufferSendIn_InputPorts()
459 getNum_schedIn_InputPorts()
469 getNum_eventOut_OutputPorts()
474#if FW_ENABLE_TEXT_LOGGING == 1
477 getNum_textEventOut_OutputPorts()
485 getNum_timeCaller_OutputPorts()
491 getNum_tlmOut_OutputPorts()
500 bool BufferManagerComponentBase ::
504 portNum < this->getNum_eventOut_OutputPorts(),
508 return this->m_eventOut_OutputPort[portNum].isConnected();
500 bool BufferManagerComponentBase :: {
…}
511#if FW_ENABLE_TEXT_LOGGING == 1
513 bool BufferManagerComponentBase ::
517 portNum < this->getNum_textEventOut_OutputPorts(),
521 return this->m_textEventOut_OutputPort[portNum].isConnected();
526 bool BufferManagerComponentBase ::
530 portNum < this->getNum_timeCaller_OutputPorts(),
534 return this->m_timeCaller_OutputPort[portNum].isConnected();
526 bool BufferManagerComponentBase :: {
…}
537 bool BufferManagerComponentBase ::
541 portNum < this->getNum_tlmOut_OutputPorts(),
545 return this->m_tlmOut_OutputPort[portNum].isConnected();
537 bool BufferManagerComponentBase :: {
…}
555 bufferGetCallee_handlerBase(
562 portNum < this->getNum_bufferGetCallee_InputPorts(),
572 retVal = this->bufferGetCallee_handler(
583 void BufferManagerComponentBase ::
584 bufferSendIn_handlerBase(
591 portNum < this->getNum_bufferSendIn_InputPorts(),
599 this->bufferSendIn_handler(
583 void BufferManagerComponentBase :: {
…}
608 void BufferManagerComponentBase ::
616 portNum < this->getNum_schedIn_InputPorts(),
621 this->schedIn_handler(
608 void BufferManagerComponentBase :: {
…}
631 void BufferManagerComponentBase ::
632 log_WARNING_HI_NoBuffsAvailable(U32 size)
635 if (this->m_NoBuffsAvailableThrottle >= EVENTID_NOBUFFSAVAILABLE_THROTTLE) {
639 this->m_NoBuffsAvailableThrottle++;
644 if (this->m_timeCaller_OutputPort[0].isConnected()) {
645 this->m_timeCaller_OutputPort[0].invoke(_logTime);
650 _id = this->getIdBase() + EVENTID_NOBUFFSAVAILABLE;
653 if (this->m_eventOut_OutputPort[0].isConnected()) {
657#if FW_AMPCS_COMPATIBLE
666#if FW_AMPCS_COMPATIBLE
669 static_cast<U8>(
sizeof(U32))
682 this->m_eventOut_OutputPort[0].invoke(
691#if FW_ENABLE_TEXT_LOGGING
692 if (this->m_textEventOut_OutputPort[0].isConnected()) {
693#if FW_OBJECT_NAMES == 1
694 const char* _formatString =
695 "(%s) %s: No available buffers of size %" PRIu32
"";
697 const char* _formatString =
698 "%s: No available buffers of size %" PRIu32
"";
717 this->m_textEventOut_OutputPort[0].invoke(
631 void BufferManagerComponentBase :: {
…}
727 void BufferManagerComponentBase ::
728 log_WARNING_HI_ZeroSizeBuffer()
731 if (this->m_ZeroSizeBufferThrottle >= EVENTID_ZEROSIZEBUFFER_THROTTLE) {
735 this->m_ZeroSizeBufferThrottle++;
740 if (this->m_timeCaller_OutputPort[0].isConnected()) {
741 this->m_timeCaller_OutputPort[0].invoke(_logTime);
746 _id = this->getIdBase() + EVENTID_ZEROSIZEBUFFER;
749 if (this->m_eventOut_OutputPort[0].isConnected()) {
752#if FW_AMPCS_COMPATIBLE
762 this->m_eventOut_OutputPort[0].invoke(
771#if FW_ENABLE_TEXT_LOGGING
772 if (this->m_textEventOut_OutputPort[0].isConnected()) {
773#if FW_OBJECT_NAMES == 1
774 const char* _formatString =
775 "(%s) %s: Received zero size buffer";
777 const char* _formatString =
778 "%s: Received zero size buffer";
796 this->m_textEventOut_OutputPort[0].invoke(
727 void BufferManagerComponentBase :: {
…}
810 void BufferManagerComponentBase ::
811 log_WARNING_HI_NoBuffsAvailable_ThrottleClear()
814 this->m_NoBuffsAvailableThrottle = 0;
810 void BufferManagerComponentBase :: {
…}
817 void BufferManagerComponentBase ::
818 log_WARNING_HI_ZeroSizeBuffer_ThrottleClear()
821 this->m_ZeroSizeBufferThrottle = 0;
817 void BufferManagerComponentBase :: {
…}
828 void BufferManagerComponentBase ::
835 if (not this->m_first_update_TotalBuffs) {
837 if (arg == this->m_last_TotalBuffs) {
841 this->m_last_TotalBuffs = arg;
845 this->m_first_update_TotalBuffs =
false;
846 this->m_last_TotalBuffs = arg;
849 if (this->m_tlmOut_OutputPort[0].isConnected()) {
851 this->m_timeCaller_OutputPort[0].isConnected() &&
854 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
866 _id = this->getIdBase() + CHANNELID_TOTALBUFFS;
868 this->m_tlmOut_OutputPort[0].invoke(
828 void BufferManagerComponentBase :: {
…}
876 void BufferManagerComponentBase ::
883 if (not this->m_first_update_CurrBuffs) {
885 if (arg == this->m_last_CurrBuffs) {
889 this->m_last_CurrBuffs = arg;
893 this->m_first_update_CurrBuffs =
false;
894 this->m_last_CurrBuffs = arg;
897 if (this->m_tlmOut_OutputPort[0].isConnected()) {
899 this->m_timeCaller_OutputPort[0].isConnected() &&
902 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
914 _id = this->getIdBase() + CHANNELID_CURRBUFFS;
916 this->m_tlmOut_OutputPort[0].invoke(
876 void BufferManagerComponentBase :: {
…}
924 void BufferManagerComponentBase ::
931 if (not this->m_first_update_HiBuffs) {
933 if (arg == this->m_last_HiBuffs) {
937 this->m_last_HiBuffs = arg;
941 this->m_first_update_HiBuffs =
false;
942 this->m_last_HiBuffs = arg;
945 if (this->m_tlmOut_OutputPort[0].isConnected()) {
947 this->m_timeCaller_OutputPort[0].isConnected() &&
950 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
962 _id = this->getIdBase() + CHANNELID_HIBUFFS;
964 this->m_tlmOut_OutputPort[0].invoke(
924 void BufferManagerComponentBase :: {
…}
972 void BufferManagerComponentBase ::
979 if (not this->m_first_update_NoBuffs) {
981 if (arg == this->m_last_NoBuffs) {
985 this->m_last_NoBuffs = arg;
989 this->m_first_update_NoBuffs =
false;
990 this->m_last_NoBuffs = arg;
993 if (this->m_tlmOut_OutputPort[0].isConnected()) {
995 this->m_timeCaller_OutputPort[0].isConnected() &&
998 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1010 _id = this->getIdBase() + CHANNELID_NOBUFFS;
1012 this->m_tlmOut_OutputPort[0].invoke(
972 void BufferManagerComponentBase :: {
…}
1020 void BufferManagerComponentBase ::
1021 tlmWrite_EmptyBuffs(
1027 if (not this->m_first_update_EmptyBuffs) {
1029 if (arg == this->m_last_EmptyBuffs) {
1033 this->m_last_EmptyBuffs = arg;
1037 this->m_first_update_EmptyBuffs =
false;
1038 this->m_last_EmptyBuffs = arg;
1041 if (this->m_tlmOut_OutputPort[0].isConnected()) {
1043 this->m_timeCaller_OutputPort[0].isConnected() &&
1046 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1058 _id = this->getIdBase() + CHANNELID_EMPTYBUFFS;
1060 this->m_tlmOut_OutputPort[0].invoke(
1020 void BufferManagerComponentBase :: {
…}
1075 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1077 this->m_timeCaller_OutputPort[0].invoke(_time);
1092 void BufferManagerComponentBase ::
1095 this->m_guardedPortMutex.lock();
1092 void BufferManagerComponentBase :: {
…}
1098 void BufferManagerComponentBase ::
1101 this->m_guardedPortMutex.unLock();
1098 void BufferManagerComponentBase :: {
…}
1109 m_p_bufferGetCallee_in(
1123 void BufferManagerComponentBase ::
1124 m_p_bufferSendIn_in(
1131 BufferManagerComponentBase* compPtr =
static_cast<BufferManagerComponentBase*
>(callComp);
1138 void BufferManagerComponentBase ::
1146 BufferManagerComponentBase* compPtr =
static_cast<BufferManagerComponentBase*
>(callComp);
1147 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_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.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Auto-generated base for BufferManager component.
Fw::Buffer bufferGetCallee_handlerBase(NATIVE_INT_TYPE portNum, U32 size)
Handler base-class function for input port bufferGetCallee.
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.