22BufferRepeater ::BufferRepeater(
const char*
const compName)
23 : BufferRepeaterComponentBase(compName),
24 m_allocation_failure_response(
BufferRepeater::NUM_BUFFER_REPEATER_FAILURE_OPTIONS) {}
27 BufferRepeaterComponentBase::init(instance);
30BufferRepeater ::~BufferRepeater() {}
33 this->m_allocation_failure_response = allocation_failure_response;
36bool BufferRepeater ::check_allocation(
FwIndexType index,
39 FW_ASSERT(index < NUM_PORTOUT_OUTPUT_PORTS, index);
40 bool is_valid = (new_allocation.
getData() !=
nullptr) && (new_allocation.
getSize() >= incoming_buffer.
getSize());
44 switch (this->m_allocation_failure_response) {
45 case NO_RESPONSE_ON_OUT_OF_MEMORY:
48 case WARNING_ON_OUT_OF_MEMORY:
49 this->log_WARNING_HI_AllocationSoftFailure(index, incoming_buffer.
getSize());
51 case FATAL_ON_OUT_OF_MEMORY:
52 this->log_FATAL_AllocationHardFailure(index, incoming_buffer.
getSize());
69 FW_ASSERT(this->m_allocation_failure_response < NUM_BUFFER_REPEATER_FAILURE_OPTIONS);
70 for (
FwIndexType i = 0; i < NUM_PORTOUT_OUTPUT_PORTS; i++) {
71 if (isConnected_portOut_OutputPort(i)) {
73 if (this->check_allocation(i, new_allocation, buffer)) {
77 this->portOut_out(i, new_allocation);
81 this->deallocate_out(0, buffer);
PlatformIntType NATIVE_INT_TYPE
PlatformIndexType FwIndexType
C++-compatible configuration header for fprime configuration.
BufferRepeaterFailureOption