File indexing completed on 2026-09-15 09:18:31
0001 #ifndef PODIO_ARROWTYPEREGISTRY_H
0002 #define PODIO_ARROWTYPEREGISTRY_H
0003
0004 #include <memory>
0005 #include <string>
0006 #include <unordered_map>
0007
0008
0009 namespace arrow {
0010 class DataType;
0011 }
0012
0013 namespace podio {
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 class ArrowTypeRegistry {
0026 public:
0027 ArrowTypeRegistry(const ArrowTypeRegistry&) = delete;
0028 ArrowTypeRegistry& operator=(const ArrowTypeRegistry&) = delete;
0029 ArrowTypeRegistry(ArrowTypeRegistry&&) = delete;
0030 ArrowTypeRegistry& operator=(ArrowTypeRegistry&&) = delete;
0031 ~ArrowTypeRegistry() = default;
0032
0033
0034 static ArrowTypeRegistry& mutInstance();
0035
0036
0037 static ArrowTypeRegistry const& instance();
0038
0039
0040
0041
0042 void registerType(const std::string& typeName, std::shared_ptr<arrow::DataType> type);
0043
0044
0045
0046
0047
0048 std::shared_ptr<arrow::DataType> getType(const std::string& typeName) const;
0049
0050 private:
0051 ArrowTypeRegistry();
0052
0053 std::unordered_map<std::string, std::shared_ptr<arrow::DataType>> m_registry;
0054 };
0055
0056 }
0057
0058 #endif