#ifndef TYPEMAPPINGS_H #define TYPEMAPPINGS_H #include #include #include #include class PgTypeContainer; class TypeMappings { public: using TypeMap = std::unordered_map; using Mapping = std::pair; TypeMappings(); TypeMappings(std::initializer_list mappings); QString getTypeForOid(Oid oid) const; const TypeMap& typeMap() const { return m_typeMap; } QString defaultStringType() const { return m_defaultStringType; } void setTypes(std::shared_ptr types); void setDefaultStringType(QString str); void setDefaultContainerType(QString str); void set(Oid oid, QString type); /** Removing a type from the mapping will reeastablish its default mapping * which in most cases is the default string type for the language. */ void remove(Oid oid); private: TypeMap m_typeMap; QString m_defaultStringType; QString m_defaultContainerType; ///< This string should contain a format variable where the element type should go std::shared_ptr m_types; }; #endif // TYPEMAPPINGS_H