22BufferRepeater ::BufferRepeater(
const char*
const compName)
24 m_allocation_failure_response(
BufferRepeater::NUM_BUFFER_REPEATER_FAILURE_OPTIONS) {}
26BufferRepeater ::~BufferRepeater() {}
29 this->m_allocation_failure_response = allocation_failure_response;
32bool BufferRepeater ::check_allocation(
FwIndexType index,
35 FW_ASSERT(index < NUM_PORTOUT_OUTPUT_PORTS, index);
36 bool is_valid = (new_allocation.
getData() !=
nullptr) && (new_allocation.
getSize() >= incoming_buffer.
getSize());
40 switch (this->m_allocation_failure_response) {
41 case NO_RESPONSE_ON_OUT_OF_MEMORY:
44 case WARNING_ON_OUT_OF_MEMORY:
45 this->log_WARNING_HI_AllocationSoftFailure(index, incoming_buffer.
getSize());
47 case FATAL_ON_OUT_OF_MEMORY:
48 this->log_FATAL_AllocationHardFailure(index, incoming_buffer.
getSize());
65 FW_ASSERT(this->m_allocation_failure_response < NUM_BUFFER_REPEATER_FAILURE_OPTIONS);
66 for (
FwIndexType i = 0; i < NUM_PORTOUT_OUTPUT_PORTS; i++) {
67 if (isConnected_portOut_OutputPort(i)) {
69 if (this->check_allocation(i, new_allocation, buffer)) {
73 this->portOut_out(i, new_allocation);
77 this->deallocate_out(0, buffer);
PlatformIntType NATIVE_INT_TYPE
PlatformIndexType FwIndexType
C++-compatible configuration header for fprime configuration.
Auto-generated base for BufferRepeater component.
BufferRepeaterFailureOption