9 #if FW_ENABLE_TEXT_LOGGING 26 #if !FW_DIRECT_PORT_CALLS 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 44 this->m_objName.toChar(),
47 this->m_bufferGetCallee_InputPort[port].setObjName(portName.
toChar());
52 #if !FW_DIRECT_PORT_CALLS 59 this->m_bufferSendIn_InputPort[port].
init();
64 this->m_bufferSendIn_InputPort[port].
setPortNum(port);
66 #if FW_OBJECT_NAMES == 1 70 this->m_objName.toChar(),
73 this->m_bufferSendIn_InputPort[port].setObjName(portName.
toChar());
78 #if !FW_DIRECT_PORT_CALLS 85 this->m_schedIn_InputPort[port].
init();
90 this->m_schedIn_InputPort[port].
setPortNum(port);
92 #if FW_OBJECT_NAMES == 1 96 this->m_objName.toChar(),
99 this->m_schedIn_InputPort[port].setObjName(portName.
toChar());
104 #if !FW_DIRECT_PORT_CALLS 111 this->m_eventOut_OutputPort[port].
init();
113 #if FW_OBJECT_NAMES == 1 117 this->m_objName.toChar(),
120 this->m_eventOut_OutputPort[port].setObjName(portName.
toChar());
125 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 129 port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
132 this->m_textEventOut_OutputPort[port].
init();
134 #if FW_OBJECT_NAMES == 1 138 this->m_objName.toChar(),
141 this->m_textEventOut_OutputPort[port].setObjName(portName.
toChar());
146 #if !FW_DIRECT_PORT_CALLS 153 this->m_timeCaller_OutputPort[port].
init();
155 #if FW_OBJECT_NAMES == 1 159 this->m_objName.toChar(),
162 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
167 #if !FW_DIRECT_PORT_CALLS 174 this->m_tlmOut_OutputPort[port].
init();
176 #if FW_OBJECT_NAMES == 1 180 this->m_objName.toChar(),
183 this->m_tlmOut_OutputPort[port].setObjName(portName.
toChar());
189 #if !FW_DIRECT_PORT_CALLS 200 static_cast<FwAssertArgType>(portNum)
203 return &this->m_bufferGetCallee_InputPort[portNum];
211 static_cast<FwAssertArgType>(portNum)
214 return &this->m_bufferSendIn_InputPort[portNum];
222 static_cast<FwAssertArgType>(portNum)
225 return &this->m_schedIn_InputPort[portNum];
230 #if !FW_DIRECT_PORT_CALLS 244 static_cast<FwAssertArgType>(portNum)
247 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
250 #if FW_ENABLE_TEXT_LOGGING == 1 252 void BufferManagerComponentBase ::
253 set_textEventOut_OutputPort(
259 (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
260 static_cast<FwAssertArgType>(portNum)
263 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
276 static_cast<FwAssertArgType>(portNum)
279 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
290 static_cast<FwAssertArgType>(portNum)
293 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
298 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 307 Fw::InputSerializePort* port
312 static_cast<FwAssertArgType>(portNum)
315 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
318 #if FW_ENABLE_TEXT_LOGGING == 1 320 void BufferManagerComponentBase ::
321 set_textEventOut_OutputPort(
323 Fw::InputSerializePort* port
327 (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
328 static_cast<FwAssertArgType>(portNum)
331 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
339 Fw::InputSerializePort* port
344 static_cast<FwAssertArgType>(portNum)
347 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
353 Fw::InputSerializePort* port
358 static_cast<FwAssertArgType>(portNum)
361 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
372 Fw::PassiveComponentBase(compName)
374 this->m_NoBuffsAvailableThrottle = 0;
375 this->m_NullEmptyBufferThrottle = 0;
384 #if !FW_DIRECT_PORT_CALLS 395 static_cast<FwAssertArgType>(portNum)
398 return this->m_eventOut_OutputPort[portNum].
isConnected();
401 #if FW_ENABLE_TEXT_LOGGING == 1 403 bool BufferManagerComponentBase ::
404 isConnected_textEventOut_OutputPort(
FwIndexType portNum)
const 407 (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
408 static_cast<FwAssertArgType>(portNum)
411 return this->m_textEventOut_OutputPort[portNum].isConnected();
421 static_cast<FwAssertArgType>(portNum)
424 return this->m_timeCaller_OutputPort[portNum].
isConnected();
432 static_cast<FwAssertArgType>(portNum)
435 return this->m_tlmOut_OutputPort[portNum].
isConnected();
455 static_cast<FwAssertArgType>(portNum)
484 static_cast<FwAssertArgType>(portNum)
509 static_cast<FwAssertArgType>(portNum)
537 this->m_NoBuffsAvailableThrottle++;
543 this->timeCaller_out(0, _logTime);
553 #if FW_AMPCS_COMPATIBLE 558 static_cast<FwAssertArgType>(_status)
562 #if FW_AMPCS_COMPATIBLE 569 static_cast<FwAssertArgType>(_status)
575 static_cast<FwAssertArgType>(_status)
588 #if FW_ENABLE_TEXT_LOGGING 589 if (this->isConnected_textEventOut_OutputPort(0)) {
590 #if FW_OBJECT_NAMES == 1 591 const char* _formatString =
592 "(%s) %s: No available buffers of size %" PRIu64
"";
594 const char* _formatString =
595 "%s: No available buffers of size %" PRIu64
"";
602 this->m_objName.toChar(),
608 this->textEventOut_out(
627 this->m_NullEmptyBufferThrottle++;
633 this->timeCaller_out(0, _logTime);
642 #if FW_AMPCS_COMPATIBLE 648 static_cast<FwAssertArgType>(_status)
662 #if FW_ENABLE_TEXT_LOGGING 663 if (this->isConnected_textEventOut_OutputPort(0)) {
664 #if FW_OBJECT_NAMES == 1 665 const char* _formatString =
666 "(%s) %s: Received null pointer and zero size buffer";
668 const char* _formatString =
669 "%s: Received null pointer and zero size buffer";
676 this->m_objName.toChar(),
681 this->textEventOut_out(
700 this->m_NoBuffsAvailableThrottle = 0;
707 this->m_NullEmptyBufferThrottle = 0;
726 this->timeCaller_out(0, _tlmTime);
752 if (not this->m_first_update_TotalBuffs) {
754 if (arg == this->m_last_TotalBuffs) {
758 this->m_last_TotalBuffs = arg;
762 this->m_first_update_TotalBuffs =
false;
763 this->m_last_TotalBuffs = arg;
771 static_cast<FwAssertArgType>(_stat)
789 if (not this->m_first_update_CurrBuffs) {
791 if (arg == this->m_last_CurrBuffs) {
795 this->m_last_CurrBuffs = arg;
799 this->m_first_update_CurrBuffs =
false;
800 this->m_last_CurrBuffs = arg;
808 static_cast<FwAssertArgType>(_stat)
826 if (not this->m_first_update_HiBuffs) {
828 if (arg == this->m_last_HiBuffs) {
832 this->m_last_HiBuffs = arg;
836 this->m_first_update_HiBuffs =
false;
837 this->m_last_HiBuffs = arg;
845 static_cast<FwAssertArgType>(_stat)
863 if (not this->m_first_update_NoBuffs) {
865 if (arg == this->m_last_NoBuffs) {
869 this->m_last_NoBuffs = arg;
873 this->m_first_update_NoBuffs =
false;
874 this->m_last_NoBuffs = arg;
882 static_cast<FwAssertArgType>(_stat)
900 if (not this->m_first_update_EmptyBuffs) {
902 if (arg == this->m_last_EmptyBuffs) {
906 this->m_last_EmptyBuffs = arg;
910 this->m_first_update_EmptyBuffs =
false;
911 this->m_last_EmptyBuffs = arg;
919 static_cast<FwAssertArgType>(_stat)
939 this->timeCaller_out(0, _time);
957 this->m_guardedPortMutex.
lock();
963 this->m_guardedPortMutex.
unLock();
971 m_p_bufferGetCallee_in(
985 void BufferManagerComponentBase ::
994 compPtr->bufferSendIn_handlerBase(
1000 void BufferManagerComponentBase ::
1009 compPtr->schedIn_handlerBase(
1015 #if !FW_DIRECT_PORT_CALLS 1021 void BufferManagerComponentBase ::
1032 static_cast<FwAssertArgType>(portNum)
1036 this->m_eventOut_OutputPort[portNum].isConnected(),
1037 static_cast<FwAssertArgType>(portNum)
1039 this->m_eventOut_OutputPort[portNum].
invoke(
1047 #if FW_ENABLE_TEXT_LOGGING 1049 void BufferManagerComponentBase ::
1059 (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
1060 static_cast<FwAssertArgType>(portNum)
1064 this->m_textEventOut_OutputPort[portNum].isConnected(),
1065 static_cast<FwAssertArgType>(portNum)
1067 this->m_textEventOut_OutputPort[portNum].invoke(
1077 void BufferManagerComponentBase ::
1085 static_cast<FwAssertArgType>(portNum)
1089 this->m_timeCaller_OutputPort[portNum].isConnected(),
1090 static_cast<FwAssertArgType>(portNum)
1092 this->m_timeCaller_OutputPort[portNum].
invoke(
1097 void BufferManagerComponentBase ::
1107 static_cast<FwAssertArgType>(portNum)
1111 this->m_tlmOut_OutputPort[portNum].isConnected(),
1112 static_cast<FwAssertArgType>(portNum)
1114 this->m_tlmOut_OutputPort[portNum].
invoke(
void log_WARNING_HI_NoBuffsAvailable(FwSizeType size)
Serialization/Deserialization operation was successful.
static constexpr FwIndexType getNum_bufferGetCallee_InputPorts()
void addCallPort(InputTimePort *callPort)
Register an input port.
Channel ID for TotalBuffs.
virtual ~BufferManagerComponentBase()
Destroy BufferManagerComponentBase object.
Channel ID for EmptyBuffs.
FwIdType getIdBase() const
PlatformSizeType FwSizeType
The BufferManager was unable to allocate a requested buffer.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
Fw::Buffer bufferGetCallee_handlerBase(FwIndexType portNum, FwSizeType size)
Handler base-class function for input port bufferGetCallee.
static constexpr FwIndexType getNum_schedIn_InputPorts()
Throttle reset count for NoBuffsAvailable.
void unLock()
unlock the mutex and assert success
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
virtual void bufferSendIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferSendIn.
The buffer manager received a null pointer and zero-sized buffer as a return. Probably undetected fai...
void init()
Initialization function.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Object initializer.
SerializeStatus
forward declaration for string
Fw::InputBufferSendPort * get_bufferSendIn_InputPort(FwIndexType portNum)
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
FwIdType FwEventIdType
The type of an event identifier.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void init()
Initialization function.
void log_WARNING_HI_NullEmptyBuffer()
void invoke(Fw::Time &time) const
Invoke a port connection.
void log_WARNING_HI_NoBuffsAvailable_ThrottleClear()
Reset throttle value for NoBuffsAvailable.
Fw::InputBufferGetPort * get_bufferGetCallee_InputPort(FwIndexType portNum)
Throttle reset count for NullEmptyBuffer.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
Channel ID for CurrBuffs.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
A serious but recoverable event.
void tlmWrite_NoBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
const char * toChar() const
Convert to a C-style char*.
Enum representing event severity.
static constexpr FwIndexType getNum_bufferSendIn_InputPorts()
void tlmWrite_CurrBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_HiBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
virtual void unLock()
Unlock the guarded mutex.
void init()
Initialization function.
void tlmWrite_TotalBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
virtual void lock()
Lock the guarded mutex.
static constexpr FwIndexType getNum_eventOut_OutputPorts()
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
void tlmWrite_EmptyBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
void log_WARNING_HI_NullEmptyBuffer_ThrottleClear()
Reset throttle value for NullEmptyBuffer.
RateGroupDivider component implementation.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual Fw::Buffer bufferGetCallee_handler(FwIndexType portNum, FwSizeType size)=0
Handler for input port bufferGetCallee.
void bufferSendIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferSendIn.
Auto-generated base for BufferManager component.
Implementation of malloc based allocator.
BufferManagerComponentBase(const char *compName="")
Construct BufferManagerComponentBase object.
void lock()
lock the mutex and assert success