10 #if FW_ENABLE_TEXT_LOGGING
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());
56 this->m_bufferSendIn_InputPort[port].
init();
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());
80 this->m_schedIn_InputPort[port].
init();
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());
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());
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());
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());
189 return &this->m_bufferGetCallee_InputPort[portNum];
200 return &this->m_bufferSendIn_InputPort[portNum];
211 return &this->m_schedIn_InputPort[portNum];
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);
261 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
275 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
278 #if FW_PORT_SERIALIZATION
287 Fw::InputSerializePort* port
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);
319 Fw::InputSerializePort* port
327 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
333 Fw::InputSerializePort* port
341 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
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;
416 #if FW_ENABLE_TEXT_LOGGING == 1
419 getNum_textEventOut_OutputPorts()
const
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();
476 return this->m_timeCaller_OutputPort[portNum].
isConnected();
487 return this->m_tlmOut_OutputPort[portNum].
isConnected();
581 this->m_NoBuffsAvailableThrottle++;
586 if (this->m_timeCaller_OutputPort[0].isConnected()) {
587 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
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(
671 this->m_ZeroSizeBufferThrottle++;
676 if (this->m_timeCaller_OutputPort[0].isConnected()) {
677 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
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(
744 this->m_NoBuffsAvailableThrottle = 0;
751 this->m_ZeroSizeBufferThrottle = 0;
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);
798 this->m_tlmOut_OutputPort[0].
invoke(
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);
846 this->m_tlmOut_OutputPort[0].
invoke(
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);
894 this->m_tlmOut_OutputPort[0].
invoke(
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);
942 this->m_tlmOut_OutputPort[0].
invoke(
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);
990 this->m_tlmOut_OutputPort[0].
invoke(
1005 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1007 this->m_timeCaller_OutputPort[0].
invoke(_time);
1025 this->m_guardedPortMutex.
lock();
1031 this->m_guardedPortMutex.
unLock();
1039 m_p_bufferGetCallee_in(
1053 void BufferManagerComponentBase ::
1054 m_p_bufferSendIn_in(
1062 compPtr->bufferSendIn_handlerBase(
1068 void BufferManagerComponentBase ::
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)
@ WARNING_HI
A serious but recoverable event.
void init()
Object initializer.
const char * toChar() const
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 format(const CHAR *formatString,...)
write formatted string to buffer
void unLock()
unlock the mutex and assert success
void lock()
lock the mutex and assert success
Auto-generated base for BufferManager component.
virtual void bufferSendIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferSendIn.
virtual void unLock()
Unlock the guarded mutex.
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
FwIndexType getNum_schedIn_InputPorts() const
FwIndexType getNum_eventOut_OutputPorts() const
Fw::InputBufferSendPort * get_bufferSendIn_InputPort(FwIndexType portNum)
void log_WARNING_HI_ZeroSizeBuffer()
BufferManagerComponentBase(const char *compName="")
Construct BufferManagerComponentBase object.
Fw::Buffer bufferGetCallee_handlerBase(FwIndexType portNum, U32 size)
Handler base-class function for input port bufferGetCallee.
void tlmWrite_HiBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
FwIndexType getNum_bufferSendIn_InputPorts() const
FwIndexType getNum_bufferGetCallee_InputPorts() const
Fw::InputBufferGetPort * get_bufferGetCallee_InputPort(FwIndexType portNum)
virtual Fw::Buffer bufferGetCallee_handler(FwIndexType portNum, U32 size)=0
Handler for input port bufferGetCallee.
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
@ 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 log_WARNING_HI_ZeroSizeBuffer_ThrottleClear()
Reset throttle value for ZeroSizeBuffer.
void log_WARNING_HI_NoBuffsAvailable(U32 size)
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void bufferSendIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferSendIn.
@ 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...
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
@ EVENTID_ZEROSIZEBUFFER_THROTTLE
Throttle reset count for ZeroSizeBuffer.
@ EVENTID_NOBUFFSAVAILABLE_THROTTLE
Throttle reset count for NoBuffsAvailable.
virtual ~BufferManagerComponentBase()
Destroy BufferManagerComponentBase object.
virtual void lock()
Lock the guarded mutex.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
void tlmWrite_EmptyBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_NoBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
FwIndexType getNum_tlmOut_OutputPorts() const
void tlmWrite_TotalBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
void tlmWrite_CurrBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
FwIndexType getNum_timeCaller_OutputPorts() const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
void log_WARNING_HI_NoBuffsAvailable_ThrottleClear()
Reset throttle value for NoBuffsAvailable.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.