Class podio::ArrowConverterRegistry

class ArrowConverterRegistry

Global singleton registry mapping PODIO type name strings to their corresponding Apache Arrow array converter callbacks.

Registration happens lazily on the first call to getConverter or getReader, when the necessary datamodel-specific Arrow converter libraries (e.g., libedm4hepArrow.so, libTestDataModelArrow.so) are loaded. It is expected that this happens before worker threads query the registry. Once populated, the registry is read-only and can be safely accessed from multiple threads concurrently.

Public Types

using CreatorFunc = std::function<std::shared_ptr<arrow::Array>(const podio::CollectionBase*)>
using BufferReaderFunc = std::function<std::optional<podio::CollectionReadBuffers>(std::shared_ptr<arrow::Array>, int64_t, bool, SchemaVersionT)>

Public Functions

ArrowConverterRegistry(const ArrowConverterRegistry&) = delete
ArrowConverterRegistry &operator=(const ArrowConverterRegistry&) = delete
ArrowConverterRegistry(ArrowConverterRegistry&&) = delete
ArrowConverterRegistry &operator=(ArrowConverterRegistry&&) = delete
~ArrowConverterRegistry() = default
void registerConverter(const std::string &typeName, CreatorFunc &&converter)

Register an Arrow array converter callback for a specific type name.

CreatorFunc getConverter(const std::string &typeName) const

Retrieve the Arrow collection converter registered for a specific type name.

Returns:

The registered CreatorFunc, or nullptr if not registered.

void registerReader(const std::string &typeName, BufferReaderFunc &&reader)

Register an Arrow array reader callback for a specific type name.

BufferReaderFunc getReader(const std::string &typeName) const

Retrieve the Arrow collection reader registered for a specific type name.

Returns:

The registered BufferReaderFunc, or nullptr if not registered.

Public Static Functions

static ArrowConverterRegistry &mutInstance()

Get the mutable singleton instance for registration.

static ArrowConverterRegistry const &instance()

Get the read-only singleton instance.