diff --git a/eci/Type.h b/eci/Type.h index 4939677..524f512 100644 --- a/eci/Type.h +++ b/eci/Type.h @@ -12,17 +12,50 @@ #include namespace eci { - class Type { + class Type : public std::enable_shared_from_this { protected: - std::string m_signature; + std::string m_signature; // !!! <== specific au language ... public: Type() {}; ~Type() {}; + virtual std::shared_ptr operator(const std::shared_ptr& _this, + const std::string& _operatorName, + const std::shared_ptr& _obj) { + ECI_ERROR("call unknow operator : '" << _operatorName << "'"); + return nullptr; + } + virtual std::vector> call(const std::shared_ptr& _this, + const std::string& _name, + const std::vector>& _objList) { + ECI_ERROR("call unknow function : '" << _name << "' with _input.size()=" << _objList.size()); + return std::vector>(); + }; + virtual std::shared_ptr getVariable(std::shared_ptr _this, + const std::string& _name) { + ECI_ERROR("try get unknow Variable : '" << _name << "'"); + return nullptr; + }; + virtual std::shared_ptr create(const std::vector>& _obj); + virtual std::shared_ptr clone(const std::vector>& _obj); }; - template class TypeBase { + class TypeNatif : public Type { + protected: + // name , opertor * / += / ++ ... + std::map, std::shared_ptr _variable>> m_operatorList; + // name , function to call + std::map>, std::vector> _variable>> m_functionList; + // + }; + template class TypeBase : public Type { + + }; + + template<> class TypeBase { + + } } #endif \ No newline at end of file diff --git a/eci/Variable.h b/eci/Variable.h index da4968c..41c2ab4 100644 --- a/eci/Variable.h +++ b/eci/Variable.h @@ -15,7 +15,7 @@ namespace eci { - class Variable { + class Variable : public std::enable_shared_from_this { public: Variable(); ~Variable(); @@ -23,7 +23,7 @@ namespace eci { enum eci::visibility m_visibility; bool m_const; std::string m_name; - eci::Type m_type; + std::shared_ptr m_type; }; }