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)
531 this->m_NoBuffsAvailableThrottle++;
537 this->timeCaller_out(0, _logTime);
547 #if FW_AMPCS_COMPATIBLE 552 static_cast<FwAssertArgType>(_status)
556 #if FW_AMPCS_COMPATIBLE 563 static_cast<FwAssertArgType>(_status)
569 static_cast<FwAssertArgType>(_status)
582 #if FW_ENABLE_TEXT_LOGGING 583 if (this->isConnected_textEventOut_OutputPort(0)) {
584 #if FW_OBJECT_NAMES == 1 585 const char* _formatString =
586 "(%s) %s: No available buffers of size %" PRIu64
"";
588 const char* _formatString =
589 "%s: No available buffers of size %" PRIu64
"";
596 this->m_objName.toChar(),
602 this->textEventOut_out(
621 this->m_NullEmptyBufferThrottle++;
627 this->timeCaller_out(0, _logTime);
636 #if FW_AMPCS_COMPATIBLE 642 static_cast<FwAssertArgType>(_status)
656 #if FW_ENABLE_TEXT_LOGGING 657 if (this->isConnected_textEventOut_OutputPort(0)) {
658 #if FW_OBJECT_NAMES == 1 659 const char* _formatString =
660 "(%s) %s: Received null pointer and zero size buffer";
662 const char* _formatString =
663 "%s: Received null pointer and zero size buffer";
670 this->m_objName.toChar(),
675 this->textEventOut_out(
694 this->m_NoBuffsAvailableThrottle = 0;
701 this->m_NullEmptyBufferThrottle = 0;
720 this->timeCaller_out(0, _tlmTime);
746 if (not this->m_first_update_TotalBuffs) {
748 if (arg == this->m_last_TotalBuffs) {
752 this->m_last_TotalBuffs = arg;
756 this->m_first_update_TotalBuffs =
false;
757 this->m_last_TotalBuffs = arg;
765 static_cast<FwAssertArgType>(_stat)
783 if (not this->m_first_update_CurrBuffs) {
785 if (arg == this->m_last_CurrBuffs) {
789 this->m_last_CurrBuffs = arg;
793 this->m_first_update_CurrBuffs =
false;
794 this->m_last_CurrBuffs = arg;
802 static_cast<FwAssertArgType>(_stat)
820 if (not this->m_first_update_HiBuffs) {
822 if (arg == this->m_last_HiBuffs) {
826 this->m_last_HiBuffs = arg;
830 this->m_first_update_HiBuffs =
false;
831 this->m_last_HiBuffs = arg;
839 static_cast<FwAssertArgType>(_stat)
857 if (not this->m_first_update_NoBuffs) {
859 if (arg == this->m_last_NoBuffs) {
863 this->m_last_NoBuffs = arg;
867 this->m_first_update_NoBuffs =
false;
868 this->m_last_NoBuffs = arg;
876 static_cast<FwAssertArgType>(_stat)
894 if (not this->m_first_update_EmptyBuffs) {
896 if (arg == this->m_last_EmptyBuffs) {
900 this->m_last_EmptyBuffs = arg;
904 this->m_first_update_EmptyBuffs =
false;
905 this->m_last_EmptyBuffs = arg;
913 static_cast<FwAssertArgType>(_stat)
933 this->timeCaller_out(0, _time);
951 this->m_guardedPortMutex.
lock();
957 this->m_guardedPortMutex.
unLock();
965 m_p_bufferGetCallee_in(
979 void BufferManagerComponentBase ::
988 compPtr->bufferSendIn_handlerBase(
994 void BufferManagerComponentBase ::
1003 compPtr->schedIn_handlerBase(
1009 #if !FW_DIRECT_PORT_CALLS 1015 void BufferManagerComponentBase ::
1026 static_cast<FwAssertArgType>(portNum)
1030 this->m_eventOut_OutputPort[portNum].isConnected(),
1031 static_cast<FwAssertArgType>(portNum)
1033 this->m_eventOut_OutputPort[portNum].
invoke(
1041 #if FW_ENABLE_TEXT_LOGGING 1043 void BufferManagerComponentBase ::
1053 (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
1054 static_cast<FwAssertArgType>(portNum)
1058 this->m_textEventOut_OutputPort[portNum].isConnected(),
1059 static_cast<FwAssertArgType>(portNum)
1061 this->m_textEventOut_OutputPort[portNum].invoke(
1071 void BufferManagerComponentBase ::
1079 static_cast<FwAssertArgType>(portNum)
1083 this->m_timeCaller_OutputPort[portNum].isConnected(),
1084 static_cast<FwAssertArgType>(portNum)
1086 this->m_timeCaller_OutputPort[portNum].
invoke(
1091 void BufferManagerComponentBase ::
1101 static_cast<FwAssertArgType>(portNum)
1105 this->m_tlmOut_OutputPort[portNum].isConnected(),
1106 static_cast<FwAssertArgType>(portNum)
1108 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.
virtual ~BufferManagerComponentBase()
Destroy BufferManagerComponentBase object.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
FwIdType getIdBase() const
PlatformSizeType FwSizeType
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()
Channel ID for TotalBuffs.
void unLock()
unlock the mutex and assert success
Channel ID for CurrBuffs.
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
virtual void bufferSendIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferSendIn.
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)
Throttle reset count for NullEmptyBuffer.
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)
const char * toChar() const
Convert to a C-style char*.
Throttle reset count for NoBuffsAvailable.
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.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
A serious but recoverable event.
void tlmWrite_NoBuffs(U32 arg, Fw::Time _tlmTime=Fw::Time())
Channel ID for EmptyBuffs.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
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.
The buffer manager received a null pointer and zero-sized buffer as a return. Probably undetected fai...
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.
The BufferManager was unable to allocate a requested buffer.
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