#pragma once #include #include #include #include #include "../util/Serializable.h" namespace ki { namespace dml { class Record; class FieldBase : public util::Serializable { friend Record; public: virtual ~FieldBase() = default; const Record &get_record() const; std::string get_name() const; bool is_transferable() const; template bool is_type() const { return (typeid(ValueT).hash_code() == m_type_hash); } protected: std::string m_name; bool m_transferable; size_t m_type_hash; FieldBase(std::string name, const Record& record); virtual FieldBase *clone(const Record &record) const = 0; private: const Record &m_record; }; typedef std::vector FieldList; typedef std::map FieldNameMap; } }