Changeset 10771 for code/branches/cpp11_v2/src/external/cpptcl
- Timestamp:
- Nov 7, 2015, 5:24:58 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/external/cpptcl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/external/cpptcl/cpptcl.cc
r8351 r10771 17 17 using namespace Tcl::details; 18 18 using namespace std; 19 // boost::shared_ptr conflicts with the new std::shared_ptr20 //using namespace boost;21 22 19 23 20 result::result(Tcl_Interp *interp) : interp_(interp) {} … … 168 165 169 166 // map of polymorphic callbacks 170 typedef map<string, boost::shared_ptr<callback_base> > callback_interp_map;167 typedef map<string, std::shared_ptr<callback_base> > callback_interp_map; 171 168 typedef map<Tcl_Interp *, callback_interp_map> callback_map; 172 169 … … 181 178 182 179 // map of object handlers 183 typedef map<string, boost::shared_ptr<class_handler_base> > class_interp_map;180 typedef map<string, std::shared_ptr<class_handler_base> > class_interp_map; 184 181 typedef map<Tcl_Interp *, class_interp_map> class_handlers_map; 185 182 … … 492 489 493 490 void class_handler_base::register_method(string const &name, 494 boost::shared_ptr<object_cmd_base> ocb, policies const &p)491 std::shared_ptr<object_cmd_base> ocb, policies const &p) 495 492 { 496 493 methods_[name] = ocb; … … 991 988 992 989 void interpreter::add_function(string const &name, 993 boost::shared_ptr<callback_base> cb, policies const &p)990 std::shared_ptr<callback_base> cb, policies const &p) 994 991 { 995 992 Tcl_CreateObjCommand(interp_, name.c_str(), … … 1001 998 1002 999 void interpreter::add_class(string const &name, 1003 boost::shared_ptr<class_handler_base> chb)1000 std::shared_ptr<class_handler_base> chb) 1004 1001 { 1005 1002 class_handlers[interp_][name] = chb; … … 1007 1004 1008 1005 void interpreter::add_constructor(string const &name, 1009 boost::shared_ptr<class_handler_base> chb, boost::shared_ptr<callback_base> cb,1006 std::shared_ptr<class_handler_base> chb, std::shared_ptr<callback_base> cb, 1010 1007 policies const &p) 1011 1008 { -
code/branches/cpp11_v2/src/external/cpptcl/cpptcl.h
r5781 r10771 17 17 #include <map> 18 18 #include <vector> 19 #include <boost/shared_ptr.hpp>20 19 #include <boost/bind.hpp> 21 20 … … 141 140 142 141 void register_method(std::string const &name, 143 boost::shared_ptr<object_cmd_base> ocb, policies const &p);142 std::shared_ptr<object_cmd_base> ocb, policies const &p); 144 143 145 144 policies & get_policies(std::string const &name); … … 148 147 typedef std::map< 149 148 std::string, 150 boost::shared_ptr<object_cmd_base>149 std::shared_ptr<object_cmd_base> 151 150 > method_map_type; 152 151 … … 214 213 { 215 214 public: 216 class_definer( boost::shared_ptr<class_handler<C> > ch) : ch_(ch) {}215 class_definer(std::shared_ptr<class_handler<C> > ch) : ch_(ch) {} 217 216 218 217 template <typename R> … … 221 220 { 222 221 ch_->register_method(name, 223 boost::shared_ptr<details::object_cmd_base>(222 std::shared_ptr<details::object_cmd_base>( 224 223 new details::method0<C, R>(f)), p); 225 224 return *this; … … 231 230 { 232 231 ch_->register_method(name, 233 boost::shared_ptr<details::object_cmd_base>(232 std::shared_ptr<details::object_cmd_base>( 234 233 new details::method0<C, R>(f)), p); 235 234 return *this; … … 241 240 { 242 241 ch_->register_method(name, 243 boost::shared_ptr<details::object_cmd_base>(242 std::shared_ptr<details::object_cmd_base>( 244 243 new details::method1<C, R, T1>(f)), p); 245 244 return *this; … … 251 250 { 252 251 ch_->register_method(name, 253 boost::shared_ptr<details::object_cmd_base>(252 std::shared_ptr<details::object_cmd_base>( 254 253 new details::method1<C, R, T1>(f)), p); 255 254 return *this; … … 261 260 { 262 261 ch_->register_method(name, 263 boost::shared_ptr<details::object_cmd_base>(262 std::shared_ptr<details::object_cmd_base>( 264 263 new details::method2<C, R, T1, T2>(f)), p); 265 264 return *this; … … 271 270 { 272 271 ch_->register_method(name, 273 boost::shared_ptr<details::object_cmd_base>(272 std::shared_ptr<details::object_cmd_base>( 274 273 new details::method2<C, R, T1, T2>(f)), p); 275 274 return *this; … … 281 280 { 282 281 ch_->register_method(name, 283 boost::shared_ptr<details::object_cmd_base>(282 std::shared_ptr<details::object_cmd_base>( 284 283 new details::method3<C, R, T1, T2, T3>(f)), p); 285 284 return *this; … … 291 290 { 292 291 ch_->register_method(name, 293 boost::shared_ptr<details::object_cmd_base>(292 std::shared_ptr<details::object_cmd_base>( 294 293 new details::method3<C, R, T1, T2, T3>(f)), p); 295 294 return *this; … … 301 300 { 302 301 ch_->register_method(name, 303 boost::shared_ptr<details::object_cmd_base>(302 std::shared_ptr<details::object_cmd_base>( 304 303 new details::method4<C, R, T1, T2, T3, T4>(f)), p); 305 304 return *this; … … 312 311 { 313 312 ch_->register_method(name, 314 boost::shared_ptr<details::object_cmd_base>(313 std::shared_ptr<details::object_cmd_base>( 315 314 new details::method4<C, R, T1, T2, T3, T4>(f)), p); 316 315 return *this; … … 323 322 { 324 323 ch_->register_method(name, 325 boost::shared_ptr<details::object_cmd_base>(324 std::shared_ptr<details::object_cmd_base>( 326 325 new details::method5<C, R, T1, T2, T3, T4, T5>(f)), p); 327 326 return *this; … … 334 333 { 335 334 ch_->register_method(name, 336 boost::shared_ptr<details::object_cmd_base>(335 std::shared_ptr<details::object_cmd_base>( 337 336 new details::method5<C, R, T1, T2, T3, T4, T5>(f)), p); 338 337 return *this; … … 345 344 { 346 345 ch_->register_method(name, 347 boost::shared_ptr<details::object_cmd_base>(346 std::shared_ptr<details::object_cmd_base>( 348 347 new details::method6<C, R, T1, T2, T3, T4, T5, T6>(f)), 349 348 p); … … 358 357 { 359 358 ch_->register_method(name, 360 boost::shared_ptr<details::object_cmd_base>(359 std::shared_ptr<details::object_cmd_base>( 361 360 new details::method6<C, R, T1, T2, T3, T4, T5, T6>(f)), 362 361 p); … … 371 370 { 372 371 ch_->register_method(name, 373 boost::shared_ptr<details::object_cmd_base>(372 std::shared_ptr<details::object_cmd_base>( 374 373 new details::method7<C, R, 375 374 T1, T2, T3, T4, T5, T6, T7>(f)), p); … … 384 383 { 385 384 ch_->register_method(name, 386 boost::shared_ptr<details::object_cmd_base>(385 std::shared_ptr<details::object_cmd_base>( 387 386 new details::method7<C, R, 388 387 T1, T2, T3, T4, T5, T6, T7>(f)), p); … … 397 396 { 398 397 ch_->register_method(name, 399 boost::shared_ptr<details::object_cmd_base>(398 std::shared_ptr<details::object_cmd_base>( 400 399 new details::method8<C, R, 401 400 T1, T2, T3, T4, T5, T6, T7, T8>(f)), p); … … 410 409 { 411 410 ch_->register_method(name, 412 boost::shared_ptr<details::object_cmd_base>(411 std::shared_ptr<details::object_cmd_base>( 413 412 new details::method8<C, R, 414 413 T1, T2, T3, T4, T5, T6, T7, T8>(f)), p); … … 423 422 { 424 423 ch_->register_method(name, 425 boost::shared_ptr<details::object_cmd_base>(424 std::shared_ptr<details::object_cmd_base>( 426 425 new details::method9<C, R, 427 426 T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p); … … 436 435 { 437 436 ch_->register_method(name, 438 boost::shared_ptr<details::object_cmd_base>(437 std::shared_ptr<details::object_cmd_base>( 439 438 new details::method9<C, R, 440 439 T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p); … … 443 442 444 443 private: 445 boost::shared_ptr<class_handler<C> > ch_;444 std::shared_ptr<class_handler<C> > ch_; 446 445 }; 447 446 … … 482 481 { 483 482 add_function(name, 484 boost::shared_ptr<details::callback_base>(483 std::shared_ptr<details::callback_base>( 485 484 new details::callback0<R>(f)), p); 486 485 } … … 491 490 { 492 491 add_function(name, 493 boost::shared_ptr<details::callback_base>(492 std::shared_ptr<details::callback_base>( 494 493 new details::callback1<R, T1>(f)), p); 495 494 } … … 500 499 { 501 500 add_function(name, 502 boost::shared_ptr<details::callback_base>(501 std::shared_ptr<details::callback_base>( 503 502 new details::callback2<R, T1, T2>(f)), p); 504 503 } … … 509 508 { 510 509 add_function(name, 511 boost::shared_ptr<details::callback_base>(510 std::shared_ptr<details::callback_base>( 512 511 new details::callback3<R, T1, T2, T3>(f)), p); 513 512 } … … 518 517 { 519 518 add_function(name, 520 boost::shared_ptr<details::callback_base>(519 std::shared_ptr<details::callback_base>( 521 520 new details::callback4<R, T1, T2, T3, T4>(f)), p); 522 521 } … … 528 527 { 529 528 add_function(name, 530 boost::shared_ptr<details::callback_base>(529 std::shared_ptr<details::callback_base>( 531 530 new details::callback5<R, T1, T2, T3, T4, T5>(f)), p); 532 531 } … … 538 537 { 539 538 add_function(name, 540 boost::shared_ptr<details::callback_base>(539 std::shared_ptr<details::callback_base>( 541 540 new details::callback6<R, T1, T2, T3, T4, T5, T6>(f)), p); 542 541 } … … 548 547 { 549 548 add_function(name, 550 boost::shared_ptr<details::callback_base>(549 std::shared_ptr<details::callback_base>( 551 550 new details::callback7<R, 552 551 T1, T2, T3, T4, T5, T6, T7>(f)), p); … … 559 558 { 560 559 add_function(name, 561 boost::shared_ptr<details::callback_base>(560 std::shared_ptr<details::callback_base>( 562 561 new details::callback8<R, 563 562 T1, T2, T3, T4, T5, T6, T7, T8>(f)), p); … … 572 571 { 573 572 add_function(name, 574 boost::shared_ptr<details::callback_base>(573 std::shared_ptr<details::callback_base>( 575 574 new details::callback9<R, 576 575 T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p); … … 583 582 details::class_definer<C> class_(std::string const &name) 584 583 { 585 boost::shared_ptr<details::class_handler<C> > ch(584 std::shared_ptr<details::class_handler<C> > ch( 586 585 new details::class_handler<C>()); 587 586 … … 589 588 590 589 add_constructor(name, ch, 591 boost::shared_ptr<details::callback_base>(590 std::shared_ptr<details::callback_base>( 592 591 new details::callback0<C*>(&details::construct< 593 592 C, void, void, void, void, void, void, void, … … 608 607 callback_type; 609 608 610 boost::shared_ptr<details::class_handler<C> > ch(609 std::shared_ptr<details::class_handler<C> > ch( 611 610 new details::class_handler<C>()); 612 611 … … 614 613 615 614 add_constructor(name, ch, 616 boost::shared_ptr<details::callback_base>(615 std::shared_ptr<details::callback_base>( 617 616 new callback_type(&details::construct< 618 617 C, T1, T2, T3, T4, T5, T6, T7, T8, T9>::doit)), p); … … 625 624 std::string const &name, details::no_init_type const &) 626 625 { 627 boost::shared_ptr<details::class_handler<C> > ch(626 std::shared_ptr<details::class_handler<C> > ch( 628 627 new details::class_handler<C>()); 629 628 … … 660 659 661 660 void add_function(std::string const &name, 662 boost::shared_ptr<details::callback_base> cb,661 std::shared_ptr<details::callback_base> cb, 663 662 policies const &p = policies()); 664 663 665 664 void add_class(std::string const &name, 666 boost::shared_ptr<details::class_handler_base> chb);665 std::shared_ptr<details::class_handler_base> chb); 667 666 668 667 void add_constructor(std::string const &name, 669 boost::shared_ptr<details::class_handler_base> chb,670 boost::shared_ptr<details::callback_base> cb,668 std::shared_ptr<details::class_handler_base> chb, 669 std::shared_ptr<details::callback_base> cb, 671 670 policies const &p = policies()); 672 671
Note: See TracChangeset
for help on using the changeset viewer.