AdapterDesc#

Fully qualified name: carb::events::AdapterDesc

Defined in carb/events/IEventsAdapter.h

struct AdapterDesc#

Describes the adapter type desired by IEventsAdapter::createAdapter().

Public Functions

inline constexpr AdapterDesc(
AdapterType type,
const char *name,
cpp::span<const MappingEntry> mappings,
eventdispatcher::IMessageQueue *messageQueue = nullptr,
) noexcept#

Constructor.

Parameters:
inline constexpr AdapterDesc(
AdapterType type,
cpp::span<const MappingEntry2> mappings,
const char *name,
eventdispatcher::IMessageQueue *messageQueue = nullptr,
) noexcept#

Constructor.

Note the parameter order is slightly different to remove ambiguity.

Parameters:

Public Members

uint32_t sizeOf = {uint32_t(sizeof(AdapterDesc))}#

Used as a version number to ensure the struct is compatible with the interface.

AdapterType type#

The type of the adapter requested.

const char *name#

The name of the adapter. This is used for debugging and logging purposes.

cpp::span<const MappingEntry> mappings#

The mappings of EventType to/from dispatch-name and push-name.

The mappings here are used two-way, so the EventType is used to look up the dispatch-name or the push-name, and vice versa. All EventType, MappingEntry::dispatchName and MappingEntry::pushName should be unique across mappings. If they are not, the adapter creation will fail.

MappingEntry::pushName is not required and is used only for AdapterType::eFull.

This parameters is mutually exclusive with mappings2.

eventdispatcher::IMessageQueue *messageQueue#

The message queue used for the adapter.

Only used for AdapterType::eFull and AdapterType::eFullAlias. Ignored for AdapterType::ePushPump and AdapterType::eDispatch.

cpp::span<const MappingEntry2> mappings2#

The mappings of EventType to/from dispatch-name and push-name with optional filter criteria.

The mappings here are used two-way, so the EventType is used to look up the dispatch-name or the push-name, and vice versa. All EventType, MappingEntry::dispatchName and MappingEntry::pushName should be unique across mappings2. If they are not, the adapter creation will fail.

If filter criteria is specified, each MappingEntry2 may have its own filter criteria and keys should not be duplicated, otherwise adapter creation will fail.

MappingEntry::pushName is not required and is used only for AdapterType::eFull.

This parameters is mutually exclusive with mappings.