diff --git a/chaiscript/chaiscript_engine.hpp b/chaiscript/chaiscript_engine.hpp index 3e7f791..e833221 100644 --- a/chaiscript/chaiscript_engine.hpp +++ b/chaiscript/chaiscript_engine.hpp @@ -193,6 +193,8 @@ namespace chaiscript Eval_Engine ss; dispatchkit::Bootstrap::bootstrap(ss); dispatchkit::bootstrap_vector >(ss, "Vector"); + dispatchkit::bootstrap_map >(ss, "Map"); + ss.register_function(boost::shared_ptr( new dispatchkit::Dynamic_Proxy_Function(boost::bind(&ChaiScript_System::eval, boost::ref(*this), _1), 1)), "eval"); diff --git a/dispatchkit/bootstrap_stl.hpp b/dispatchkit/bootstrap_stl.hpp index f5fecb9..0874cbf 100644 --- a/dispatchkit/bootstrap_stl.hpp +++ b/dispatchkit/bootstrap_stl.hpp @@ -130,6 +130,41 @@ namespace dispatchkit bootstrap_random_access_container(system, type); bootstrap_back_insertion_sequence(system, type); } + + template + void bootstrap_associative_container(Dispatch_Engine &system, const std::string &type) + { + bootstrap_forward_container(system, type); + bootstrap_default_constructible(system, type); + } + + + template + void bootstrap_unique_associative_container(Dispatch_Engine &system, const std::string &type) + { + bootstrap_associative_container(system, type); + } + + template + void bootstrap_sorted_associative_container(Dispatch_Engine &system, const std::string &type) + { + bootstrap_reversible_container(system, type); + } + + template + void bootstrap_unique_sorted_associative_container(Dispatch_Engine &system, const std::string &type) + { + bootstrap_sorted_associative_container(system, type); + bootstrap_unique_associative_container(system, type); + } + + template + void bootstrap_map(Dispatch_Engine &system, const std::string &type) + { + system.register_type(type); + register_function(system, &MapType::operator[], "[]"); + bootstrap_unique_sorted_associative_container(system, type); + } } #endif