From 3b220bd4dcfdc6f67bd8432b90e846e19aa70b6f Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Thu, 11 Jun 2009 15:52:44 +0000 Subject: [PATCH] Name change from BoxedCPP_System to Dispatch_Engine --- boxedcpp/bootstrap.hpp | 50 +++++++++++++++++----------------- boxedcpp/bootstrap_stl.hpp | 18 ++++++------ boxedcpp/boxedcpp.hpp | 16 +++++------ boxedcpp/register_function.hpp | 4 +-- boxedcpp/test.cpp | 6 ++-- boxedcpp/unittest.cpp | 2 +- wesley/wesley_engine.hpp | 2 +- wesley/wesley_eval.hpp | 16 +++++------ 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/boxedcpp/bootstrap.hpp b/boxedcpp/bootstrap.hpp index 88f5a5e..d0a854a 100644 --- a/boxedcpp/bootstrap.hpp +++ b/boxedcpp/bootstrap.hpp @@ -246,95 +246,95 @@ P1 &prefixnot(P1 &p1) //Add canonical forms of operators template -void add_oper_equals(BoxedCPP_System &s) +void add_oper_equals(Dispatch_Engine &s) { register_function(s, &equals, "="); } template -void add_oper_add(BoxedCPP_System &s) +void add_oper_add(Dispatch_Engine &s) { register_function(s, &add, "+"); } template -void add_oper_add_equals(BoxedCPP_System &s) +void add_oper_add_equals(Dispatch_Engine &s) { register_function(s, &addsequal, "+="); } template -void add_oper_subtract(BoxedCPP_System &s) +void add_oper_subtract(Dispatch_Engine &s) { register_function(s, &subtract, "-"); } template -void add_oper_divide(BoxedCPP_System &s) +void add_oper_divide(Dispatch_Engine &s) { register_function(s, ÷, "-"); } template -void add_oper_multiply(BoxedCPP_System &s) +void add_oper_multiply(Dispatch_Engine &s) { register_function(s, &multiply, "*"); } template -void add_oper_not_equals(BoxedCPP_System &s) +void add_oper_not_equals(Dispatch_Engine &s) { register_function(s, ¬_equals, "!="); } template -void add_oper_assign_overload(BoxedCPP_System &s) +void add_oper_assign_overload(Dispatch_Engine &s) { register_function(s, &assign, "="); } template -void add_oper_assign(BoxedCPP_System &s) +void add_oper_assign(Dispatch_Engine &s) { register_function(s, &assign, "="); } template -void add_oper_assign_pod(BoxedCPP_System &s) +void add_oper_assign_pod(Dispatch_Engine &s) { register_function(s, &assign_pod, "="); } template -void add_oper_less_than(BoxedCPP_System &s) +void add_oper_less_than(Dispatch_Engine &s) { register_function(s, &less_than, "<"); } template -void add_oper_greater_than(BoxedCPP_System &s) +void add_oper_greater_than(Dispatch_Engine &s) { register_function(s, &greater_than, ">"); } template -void add_oper_less_than_equals(BoxedCPP_System &s) +void add_oper_less_than_equals(Dispatch_Engine &s) { register_function(s, &less_than_equals, "<="); } template -void add_oper_greater_than_equals(BoxedCPP_System &s) +void add_oper_greater_than_equals(Dispatch_Engine &s) { register_function(s, &greater_than_equals, ">="); } template -void add_opers_comparison_overload(BoxedCPP_System &s) +void add_opers_comparison_overload(Dispatch_Engine &s) { register_function(s, &equals, "=="); register_function(s, ¬_equals, "!="); @@ -344,7 +344,7 @@ void add_opers_comparison_overload(BoxedCPP_System &s) register_function(s, &greater_than_equals, ">="); } -void add_opers_comparison_pod(BoxedCPP_System &s) +void add_opers_comparison_pod(Dispatch_Engine &s) { register_function(s, &pod_equals, "=="); register_function(s, &pod_not_equals, "!="); @@ -354,7 +354,7 @@ void add_opers_comparison_pod(BoxedCPP_System &s) register_function(s, &pod_greater_than_equals, ">="); } -void add_opers_arithmetic_pod(BoxedCPP_System &s) +void add_opers_arithmetic_pod(Dispatch_Engine &s) { register_function(s, &pod_add, "+"); register_function(s, &pod_subtract, "-"); @@ -363,13 +363,13 @@ void add_opers_arithmetic_pod(BoxedCPP_System &s) } template -void add_opers_comparison(BoxedCPP_System &s) +void add_opers_comparison(Dispatch_Engine &s) { add_opers_comparison_overload(s); } template -void add_opers_arithmetic_overload(BoxedCPP_System &s) +void add_opers_arithmetic_overload(Dispatch_Engine &s) { register_function(s, &add, "+"); register_function(s, &subtract, "-"); @@ -386,7 +386,7 @@ void add_opers_arithmetic_overload(BoxedCPP_System &s) } template -void add_opers_arithmetic_modify_pod(BoxedCPP_System &s) +void add_opers_arithmetic_modify_pod(Dispatch_Engine &s) { register_function(s, ×equal_pod, "*="); register_function(s, ÷sequal_pod, "/="); @@ -395,7 +395,7 @@ void add_opers_arithmetic_modify_pod(BoxedCPP_System &s) } template -void add_basic_constructors(BoxedCPP_System &s, const std::string &type) +void add_basic_constructors(Dispatch_Engine &s, const std::string &type) { s.register_function(build_constructor(), type); s.register_function(build_constructor(), type); @@ -403,13 +403,13 @@ void add_basic_constructors(BoxedCPP_System &s, const std::string &type) } template -void add_constructor_overload(BoxedCPP_System &s, const std::string &type) +void add_constructor_overload(Dispatch_Engine &s, const std::string &type) { s.register_function(build_constructor(), type); } template -void add_opers_arithmetic(BoxedCPP_System &s) +void add_opers_arithmetic(Dispatch_Engine &s) { add_opers_arithmetic_overload(s); @@ -464,7 +464,7 @@ template<> std::string to_string(bool b) } template -void bootstrap_pod_type(BoxedCPP_System &s, const std::string &name) +void bootstrap_pod_type(Dispatch_Engine &s, const std::string &name) { s.register_type(name); add_basic_constructors(s, name); @@ -480,7 +480,7 @@ void print(const std::string &s) std::cout << s << std::endl; } -void bootstrap(BoxedCPP_System &s) +void bootstrap(Dispatch_Engine &s) { s.register_type("void"); diff --git a/boxedcpp/bootstrap_stl.hpp b/boxedcpp/bootstrap_stl.hpp index 7e0a3f5..f5bd0e9 100644 --- a/boxedcpp/bootstrap_stl.hpp +++ b/boxedcpp/bootstrap_stl.hpp @@ -4,12 +4,12 @@ #include "boxedcpp.hpp" template -void bootstrap_reversible_container(BoxedCPP_System &system, const std::string &type) +void bootstrap_reversible_container(Dispatch_Engine &system, const std::string &type) { } template -void bootstrap_random_access_container(BoxedCPP_System &system, const std::string &type) +void bootstrap_random_access_container(Dispatch_Engine &system, const std::string &type) { bootstrap_reversible_container(system, type); @@ -22,14 +22,14 @@ void bootstrap_random_access_container(BoxedCPP_System &system, const std::strin } template -void bootstrap_assignable(BoxedCPP_System &system, const std::string &type) +void bootstrap_assignable(Dispatch_Engine &system, const std::string &type) { system.register_function( boost::function(&Assignable::operator=), "="); } template -void bootstrap_container(BoxedCPP_System &system, const std::string &type) +void bootstrap_container(Dispatch_Engine &system, const std::string &type) { bootstrap_assignable(system, type); @@ -40,26 +40,26 @@ void bootstrap_container(BoxedCPP_System &system, const std::string &type) } template -void bootstrap_forward_container(BoxedCPP_System &system, const std::string &type) +void bootstrap_forward_container(Dispatch_Engine &system, const std::string &type) { bootstrap_container(system, type); } template -void bootstrap_default_constructible(BoxedCPP_System &system, const std::string &type) +void bootstrap_default_constructible(Dispatch_Engine &system, const std::string &type) { system.register_function(build_constructor(), type); } template -void bootstrap_sequence(BoxedCPP_System &system, const std::string &type) +void bootstrap_sequence(Dispatch_Engine &system, const std::string &type) { bootstrap_forward_container(system, type); bootstrap_default_constructible(system, type); } template -void bootstrap_back_insertion_sequence(BoxedCPP_System &system, const std::string &type) +void bootstrap_back_insertion_sequence(Dispatch_Engine &system, const std::string &type) { bootstrap_sequence(system, type); @@ -72,7 +72,7 @@ void bootstrap_back_insertion_sequence(BoxedCPP_System &system, const std::strin } template -void bootstrap_vector(BoxedCPP_System &system, const std::string &type) +void bootstrap_vector(Dispatch_Engine &system, const std::string &type) { system.register_type(type); bootstrap_random_access_container(system, type); diff --git a/boxedcpp/boxedcpp.hpp b/boxedcpp/boxedcpp.hpp index 7f95529..2ea25e5 100644 --- a/boxedcpp/boxedcpp.hpp +++ b/boxedcpp/boxedcpp.hpp @@ -16,7 +16,7 @@ #include "proxy_functions.hpp" #include "proxy_constructors.hpp" -class BoxedCPP_System +class Dispatch_Engine { public: typedef std::multimap > Function_Map; @@ -24,7 +24,7 @@ class BoxedCPP_System typedef std::map Scope; typedef std::deque Stack; - BoxedCPP_System() + Dispatch_Engine() { m_scopes.push_back(Scope()); } @@ -160,7 +160,7 @@ void dump_type(const Type_Info &type) std::cout << type.m_bare_type_info->name(); } -void dump_function(const BoxedCPP_System::Function_Map::value_type &f) +void dump_function(const Dispatch_Engine::Function_Map::value_type &f) { std::vector params = f.second->get_param_types(); @@ -178,11 +178,11 @@ void dump_function(const BoxedCPP_System::Function_Map::value_type &f) std::cout << ")" << std::endl; } -void dump_system(const BoxedCPP_System &s) +void dump_system(const Dispatch_Engine &s) { std::cout << "Registered Types: " << std::endl; - std::vector types = s.get_types(); - for (std::vector::const_iterator itr = types.begin(); + std::vector types = s.get_types(); + for (std::vector::const_iterator itr = types.begin(); itr != types.end(); ++itr) { @@ -192,10 +192,10 @@ void dump_system(const BoxedCPP_System &s) } - std::cout << std::endl; std::vector funcs = s.get_functions(); + std::cout << std::endl; std::vector funcs = s.get_functions(); std::cout << "Functions: " << std::endl; - for (std::vector::const_iterator itr = funcs.begin(); + for (std::vector::const_iterator itr = funcs.begin(); itr != funcs.end(); ++itr) { diff --git a/boxedcpp/register_function.hpp b/boxedcpp/register_function.hpp index bba2216..1362f82 100644 --- a/boxedcpp/register_function.hpp +++ b/boxedcpp/register_function.hpp @@ -19,13 +19,13 @@ # define n BOOST_PP_ITERATION() template -void register_function(BoxedCPP_System &s, Ret (*f)(BOOST_PP_ENUM_PARAMS(n, Param)), const std::string &name) +void register_function(Dispatch_Engine &s, Ret (*f)(BOOST_PP_ENUM_PARAMS(n, Param)), const std::string &name) { s.register_function(boost::function(f), name); } template -void register_function(BoxedCPP_System &s, Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param)), const std::string &name) +void register_function(Dispatch_Engine &s, Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param)), const std::string &name) { s.register_function(boost::function(f), name); } diff --git a/boxedcpp/test.cpp b/boxedcpp/test.cpp index d37d9af..5e15d38 100644 --- a/boxedcpp/test.cpp +++ b/boxedcpp/test.cpp @@ -31,7 +31,7 @@ struct Test -Boxed_Value named_func_call(BoxedCPP_System &ss, +Boxed_Value named_func_call(Dispatch_Engine &ss, const std::string &nametocall, const std::vector ¶ms) { if (params.size() == 2) @@ -45,7 +45,7 @@ Boxed_Value named_func_call(BoxedCPP_System &ss, // A function that takes a dynamic list of params // and calls a bunch of conversion functions on them and // returns the result as a boxed_value -Boxed_Value dynamic_function(BoxedCPP_System &ss, const std::string &name, +Boxed_Value dynamic_function(Dispatch_Engine &ss, const std::string &name, const std::vector ¶ms) { if (name == "concat_string") @@ -87,7 +87,7 @@ void test(const std::string &p) //Test main int main() { - BoxedCPP_System ss; + Dispatch_Engine ss; bootstrap(ss); bootstrap_vector >(ss, "VectorInt"); dump_system(ss); diff --git a/boxedcpp/unittest.cpp b/boxedcpp/unittest.cpp index c382206..1062a2a 100644 --- a/boxedcpp/unittest.cpp +++ b/boxedcpp/unittest.cpp @@ -7,7 +7,7 @@ BOOST_AUTO_TEST_CASE( add_operators ) { - BoxedCPP_System ss; + Dispatch_Engine ss; bootstrap(ss); dump_system(ss); diff --git a/wesley/wesley_engine.hpp b/wesley/wesley_engine.hpp index 7262d3a..4f1a4ad 100644 --- a/wesley/wesley_engine.hpp +++ b/wesley/wesley_engine.hpp @@ -262,7 +262,7 @@ public: } }; -typedef Wesley_System Wesley_Engine; +typedef Wesley_System Wesley_Engine; #endif /* WESLEY_ENGINE_HPP_ */ diff --git a/wesley/wesley_eval.hpp b/wesley/wesley_eval.hpp index f4118d4..b48c55c 100644 --- a/wesley/wesley_eval.hpp +++ b/wesley/wesley_eval.hpp @@ -206,11 +206,11 @@ Boxed_Value eval_token(Eval_System &ss, TokenPtr node) { break; case (TokenType::Fun_Call) : { - std::vector > fn; - BoxedCPP_System::Stack prev_stack = ss.get_stack(); + std::vector > fn; + Dispatch_Engine::Stack prev_stack = ss.get_stack(); - BoxedCPP_System::Stack new_stack; - new_stack.push_back(BoxedCPP_System::Scope()); + Dispatch_Engine::Stack new_stack; + new_stack.push_back(Dispatch_Engine::Scope()); Param_List_Builder plb; for (i = 1; i < node->children.size(); ++i) { @@ -237,11 +237,11 @@ Boxed_Value eval_token(Eval_System &ss, TokenPtr node) { } break; case (TokenType::Method_Call) : { - std::vector > fn; - BoxedCPP_System::Stack prev_stack = ss.get_stack(); + std::vector > fn; + Dispatch_Engine::Stack prev_stack = ss.get_stack(); - BoxedCPP_System::Stack new_stack; - new_stack.push_back(BoxedCPP_System::Scope()); + Dispatch_Engine::Stack new_stack; + new_stack.push_back(Dispatch_Engine::Scope()); retval = eval_token(ss, node->children[0]); if (node->children.size() > 1) {