[8351] | 1 | --- cpptcl.cc Fri Apr 22 12:18:47 2011 |
---|
| 2 | +++ cpptcl.cc Fri Apr 22 12:20:02 2011 |
---|
| 3 | @@ -16,7 +16,8 @@ |
---|
| 4 | using namespace Tcl; |
---|
| 5 | using namespace Tcl::details; |
---|
| 6 | using namespace std; |
---|
| 7 | -using namespace boost; |
---|
| 8 | +// boost::shared_ptr conflicts with the new std::shared_ptr |
---|
| 9 | +//using namespace boost; |
---|
[2705] | 10 | |
---|
[8351] | 11 | |
---|
| 12 | result::result(Tcl_Interp *interp) : interp_(interp) {} |
---|
| 13 | @@ -166,7 +167,7 @@ |
---|
| 14 | { |
---|
| 15 | |
---|
| 16 | // map of polymorphic callbacks |
---|
| 17 | -typedef map<string, shared_ptr<callback_base> > callback_interp_map; |
---|
| 18 | +typedef map<string, boost::shared_ptr<callback_base> > callback_interp_map; |
---|
| 19 | typedef map<Tcl_Interp *, callback_interp_map> callback_map; |
---|
| 20 | |
---|
| 21 | callback_map callbacks; |
---|
| 22 | @@ -179,7 +180,7 @@ |
---|
| 23 | policies_map call_policies; |
---|
| 24 | |
---|
| 25 | // map of object handlers |
---|
| 26 | -typedef map<string, shared_ptr<class_handler_base> > class_interp_map; |
---|
| 27 | +typedef map<string, boost::shared_ptr<class_handler_base> > class_interp_map; |
---|
| 28 | typedef map<Tcl_Interp *, class_interp_map> class_handlers_map; |
---|
| 29 | |
---|
| 30 | class_handlers_map class_handlers; |
---|
| 31 | @@ -320,7 +321,7 @@ |
---|
| 32 | |
---|
[2705] | 33 | post_process_policies(interp, pol, objv, false); |
---|
| 34 | } |
---|
| 35 | - catch (exception const &e) |
---|
| 36 | + catch (std::exception const &e) |
---|
| 37 | { |
---|
| 38 | Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE); |
---|
| 39 | return TCL_ERROR; |
---|
[8351] | 40 | @@ -363,7 +364,7 @@ |
---|
[2705] | 41 | |
---|
| 42 | post_process_policies(interp, pol, objv, true); |
---|
| 43 | } |
---|
| 44 | - catch (exception const &e) |
---|
| 45 | + catch (std::exception const &e) |
---|
| 46 | { |
---|
| 47 | Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE); |
---|
| 48 | return TCL_ERROR; |
---|
[8351] | 49 | @@ -430,7 +431,7 @@ |
---|
[2705] | 50 | Tcl_GetString(Tcl_GetObjResult(interp)), |
---|
| 51 | object_handler, static_cast<ClientData>(chb), 0); |
---|
| 52 | } |
---|
| 53 | - catch (exception const &e) |
---|
| 54 | + catch (std::exception const &e) |
---|
| 55 | { |
---|
| 56 | Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE); |
---|
| 57 | return TCL_ERROR; |
---|
[8351] | 58 | @@ -490,7 +491,7 @@ |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | void class_handler_base::register_method(string const &name, |
---|
| 62 | - shared_ptr<object_cmd_base> ocb, policies const &p) |
---|
| 63 | + boost::shared_ptr<object_cmd_base> ocb, policies const &p) |
---|
| 64 | { |
---|
| 65 | methods_[name] = ocb; |
---|
| 66 | policies_[name] = p; |
---|
| 67 | @@ -989,7 +990,7 @@ |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | void interpreter::add_function(string const &name, |
---|
| 71 | - shared_ptr<callback_base> cb, policies const &p) |
---|
| 72 | + boost::shared_ptr<callback_base> cb, policies const &p) |
---|
| 73 | { |
---|
| 74 | Tcl_CreateObjCommand(interp_, name.c_str(), |
---|
| 75 | callback_handler, 0, 0); |
---|
| 76 | @@ -999,13 +1000,13 @@ |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | void interpreter::add_class(string const &name, |
---|
| 80 | - shared_ptr<class_handler_base> chb) |
---|
| 81 | + boost::shared_ptr<class_handler_base> chb) |
---|
| 82 | { |
---|
| 83 | class_handlers[interp_][name] = chb; |
---|
| 84 | } |
---|
| 85 | |
---|
| 86 | void interpreter::add_constructor(string const &name, |
---|
| 87 | - shared_ptr<class_handler_base> chb, shared_ptr<callback_base> cb, |
---|
| 88 | + boost::shared_ptr<class_handler_base> chb, boost::shared_ptr<callback_base> cb, |
---|
| 89 | policies const &p) |
---|
| 90 | { |
---|
| 91 | Tcl_CreateObjCommand(interp_, name.c_str(), |
---|