36#ifndef IMT_BASE_DFF_ACTIVEPARTS_PORTINPUTSPLIT_H
37#define IMT_BASE_DFF_ACTIVEPARTS_PORTINPUTSPLIT_H
50namespace activeparts {
55template<u
int32_t NumberOfPortsToSplit>
70 for (
uint_fast32_t i {0U}; i < m_numberOfRegisteredReceivers; i++) {
71 m_receiverDetails[i].m_pPortIn->receive(protocolIdentifier, pEventData, eventDataSizeBytes);
79 if (m_numberOfRegisteredReceivers <= 0U) {
80 return ::imt::base::dff::runtime::RuntimeCore::COREHANDLE_INVALID;
82 return m_receiverDetails[0U].m_pPortIn->getReceiveHandle();
89 if (m_numberOfRegisteredReceivers <= 0U) {
90 return ::imt::base::dff::runtime::RuntimePriority::Prio_lowest;
92 return m_receiverDetails[0U].m_receiverPriority;
101 if (m_numberOfRegisteredReceivers >= NumberOfPortsToSplit) {
102 ASSERT_DEBUG1(
false,
"number of receivers exceeds template parameter (PortInputSplit::split)");
108 ASSERT_DEBUG1(
false,
"invalid handle passed (PortInputSplit::split)");
114 uint32_t i {m_numberOfRegisteredReceivers};
116 while ((i >= 1U) && (currentPriority > m_receiverDetails[i - 1U].m_receiverPriority)) {
118 m_receiverDetails[i] = m_receiverDetails[i - 1U];
123 m_receiverDetails[i].m_pPortIn = &portIn;
124 m_receiverDetails[i].m_receiverPriority = currentPriority;
125 m_numberOfRegisteredReceivers++;
137 if (index < NumberOfPortsToSplit) {
138 return m_receiverDetails[index].m_pPortIn;
147 struct ReceiverDetails {
152 uint32_t m_numberOfRegisteredReceivers {0U};
153 std::array<ReceiverDetails, NumberOfPortsToSplit> m_receiverDetails {};
void ASSERT_DEBUG1(bool const condition, char_t const *const pMessage) noexcept
"Assert for debugging only" (ASSERT_DEBUG).
Serialization is the process of translating data structures into a binary representation.
Interface for any receiver to be called on received serialized data.s.
ReceiverIfc() noexcept=default
virtual ::imt::base::dff::runtime::RuntimeCore::CoreHandle getReceiveHandle() const =0
Get the handle of this input.
virtual ::imt::base::dff::runtime::RuntimePriority getReceivePriority() const =0
Get the priority of this input.
static constexpr CoreHandle COREHANDLE_INVALID
Constant which represents an invalid CoreHandle.
int16_t CoreHandle
A CoreHandle is used to identify an executable with a unique number (similar to a phone number).
RuntimePriority
Runtime executable priorities (=software priorities) The priorities start at 1 with lowest priority,...
This is a application specific file which is used to configure Imt.Base.Core.Math.
unsigned __int16 uint16_t
unsigned __int32 uint32_t