Changeset 11071 for code/trunk/src/external/cpptcl/cpptcl.h
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/external/cpptcl/cpptcl.h
r5781 r11071 17 17 #include <map> 18 18 #include <vector> 19 #include <boost/shared_ptr.hpp> 20 #include <boost/bind.hpp> 21 19 #include <memory> 20 #include <functional> 22 21 23 22 namespace Tcl 24 23 { 24 namespace arg = std::placeholders; 25 25 26 26 // exception class used for reporting all Tcl errors … … 141 141 142 142 void register_method(std::string const &name, 143 boost::shared_ptr<object_cmd_base> ocb, policies const &p);143 std::shared_ptr<object_cmd_base> ocb, policies const &p); 144 144 145 145 policies & get_policies(std::string const &name); … … 148 148 typedef std::map< 149 149 std::string, 150 boost::shared_ptr<object_cmd_base>150 std::shared_ptr<object_cmd_base> 151 151 > method_map_type; 152 152 … … 214 214 { 215 215 public: 216 class_definer( boost::shared_ptr<class_handler<C> > ch) : ch_(ch) {}216 class_definer(std::shared_ptr<class_handler<C> > ch) : ch_(ch) {} 217 217 218 218 template <typename R> … … 221 221 { 222 222 ch_->register_method(name, 223 boost::shared_ptr<details::object_cmd_base>(223 std::shared_ptr<details::object_cmd_base>( 224 224 new details::method0<C, R>(f)), p); 225 225 return *this; … … 231 231 { 232 232 ch_->register_method(name, 233 boost::shared_ptr<details::object_cmd_base>(233 std::shared_ptr<details::object_cmd_base>( 234 234 new details::method0<C, R>(f)), p); 235 235 return *this; … … 241 241 { 242 242 ch_->register_method(name, 243 boost::shared_ptr<details::object_cmd_base>(243 std::shared_ptr<details::object_cmd_base>( 244 244 new details::method1<C, R, T1>(f)), p); 245 245 return *this; … … 251 251 { 252 252 ch_->register_method(name, 253 boost::shared_ptr<details::object_cmd_base>(253 std::shared_ptr<details::object_cmd_base>( 254 254 new details::method1<C, R, T1>(f)), p); 255 255 return *this; … … 261 261 { 262 262 ch_->register_method(name, 263 boost::shared_ptr<details::object_cmd_base>(263 std::shared_ptr<details::object_cmd_base>( 264 264 new details::method2<C, R, T1, T2>(f)), p); 265 265 return *this; … … 271 271 { 272 272 ch_->register_method(name, 273 boost::shared_ptr<details::object_cmd_base>(273 std::shared_ptr<details::object_cmd_base>( 274 274 new details::method2<C, R, T1, T2>(f)), p); 275 275 return *this; … … 281 281 { 282 282 ch_->register_method(name, 283 boost::shared_ptr<details::object_cmd_base>(283 std::shared_ptr<details::object_cmd_base>( 284 284 new details::method3<C, R, T1, T2, T3>(f)), p); 285 285 return *this; … … 291 291 { 292 292 ch_->register_method(name, 293 boost::shared_ptr<details::object_cmd_base>(293 std::shared_ptr<details::object_cmd_base>( 294 294 new details::method3<C, R, T1, T2, T3>(f)), p); 295 295 return *this; … … 301 301 { 302 302 ch_->register_method(name, 303 boost::shared_ptr<details::object_cmd_base>(303 std::shared_ptr<details::object_cmd_base>( 304 304 new details::method4<C, R, T1, T2, T3, T4>(f)), p); 305 305 return *this; … … 312 312 { 313 313 ch_->register_method(name, 314 boost::shared_ptr<details::object_cmd_base>(314 std::shared_ptr<details::object_cmd_base>( 315 315 new details::method4<C, R, T1, T2, T3, T4>(f)), p); 316 316 return *this; … … 323 323 { 324 324 ch_->register_method(name, 325 boost::shared_ptr<details::object_cmd_base>(325 std::shared_ptr<details::object_cmd_base>( 326 326 new details::method5<C, R, T1, T2, T3, T4, T5>(f)), p); 327 327 return *this; … … 334 334 { 335 335 ch_->register_method(name, 336 boost::shared_ptr<details::object_cmd_base>(336 std::shared_ptr<details::object_cmd_base>( 337 337 new details::method5<C, R, T1, T2, T3, T4, T5>(f)), p); 338 338 return *this; … … 345 345 { 346 346 ch_->register_method(name, 347 boost::shared_ptr<details::object_cmd_base>(347 std::shared_ptr<details::object_cmd_base>( 348 348 new details::method6<C, R, T1, T2, T3, T4, T5, T6>(f)), 349 349 p); … … 358 358 { 359 359 ch_->register_method(name, 360 boost::shared_ptr<details::object_cmd_base>(360 std::shared_ptr<details::object_cmd_base>( 361 361 new details::method6<C, R, T1, T2, T3, T4, T5, T6>(f)), 362 362 p); … … 371 371 { 372 372 ch_->register_method(name, 373 boost::shared_ptr<details::object_cmd_base>(373 std::shared_ptr<details::object_cmd_base>( 374 374 new details::method7<C, R, 375 375 T1, T2, T3, T4, T5, T6, T7>(f)), p); … … 384 384 { 385 385 ch_->register_method(name, 386 boost::shared_ptr<details::object_cmd_base>(386 std::shared_ptr<details::object_cmd_base>( 387 387 new details::method7<C, R, 388 388 T1, T2, T3, T4, T5, T6, T7>(f)), p); … … 397 397 { 398 398 ch_->register_method(name, 399 boost::shared_ptr<details::object_cmd_base>(399 std::shared_ptr<details::object_cmd_base>( 400 400 new details::method8<C, R, 401 401 T1, T2, T3, T4, T5, T6, T7, T8>(f)), p); … … 410 410 { 411 411 ch_->register_method(name, 412 boost::shared_ptr<details::object_cmd_base>(412 std::shared_ptr<details::object_cmd_base>( 413 413 new details::method8<C, R, 414 414 T1, T2, T3, T4, T5, T6, T7, T8>(f)), p); … … 423 423 { 424 424 ch_->register_method(name, 425 boost::shared_ptr<details::object_cmd_base>(425 std::shared_ptr<details::object_cmd_base>( 426 426 new details::method9<C, R, 427 427 T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p); … … 436 436 { 437 437 ch_->register_method(name, 438 boost::shared_ptr<details::object_cmd_base>(438 std::shared_ptr<details::object_cmd_base>( 439 439 new details::method9<C, R, 440 440 T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p); … … 443 443 444 444 private: 445 boost::shared_ptr<class_handler<C> > ch_;445 std::shared_ptr<class_handler<C> > ch_; 446 446 }; 447 447 … … 482 482 { 483 483 add_function(name, 484 boost::shared_ptr<details::callback_base>(484 std::shared_ptr<details::callback_base>( 485 485 new details::callback0<R>(f)), p); 486 486 } … … 491 491 { 492 492 add_function(name, 493 boost::shared_ptr<details::callback_base>(493 std::shared_ptr<details::callback_base>( 494 494 new details::callback1<R, T1>(f)), p); 495 495 } … … 500 500 { 501 501 add_function(name, 502 boost::shared_ptr<details::callback_base>(502 std::shared_ptr<details::callback_base>( 503 503 new details::callback2<R, T1, T2>(f)), p); 504 504 } … … 509 509 { 510 510 add_function(name, 511 boost::shared_ptr<details::callback_base>(511 std::shared_ptr<details::callback_base>( 512 512 new details::callback3<R, T1, T2, T3>(f)), p); 513 513 } … … 518 518 { 519 519 add_function(name, 520 boost::shared_ptr<details::callback_base>(520 std::shared_ptr<details::callback_base>( 521 521 new details::callback4<R, T1, T2, T3, T4>(f)), p); 522 522 } … … 528 528 { 529 529 add_function(name, 530 boost::shared_ptr<details::callback_base>(530 std::shared_ptr<details::callback_base>( 531 531 new details::callback5<R, T1, T2, T3, T4, T5>(f)), p); 532 532 } … … 538 538 { 539 539 add_function(name, 540 boost::shared_ptr<details::callback_base>(540 std::shared_ptr<details::callback_base>( 541 541 new details::callback6<R, T1, T2, T3, T4, T5, T6>(f)), p); 542 542 } … … 548 548 { 549 549 add_function(name, 550 boost::shared_ptr<details::callback_base>(550 std::shared_ptr<details::callback_base>( 551 551 new details::callback7<R, 552 552 T1, T2, T3, T4, T5, T6, T7>(f)), p); … … 559 559 { 560 560 add_function(name, 561 boost::shared_ptr<details::callback_base>(561 std::shared_ptr<details::callback_base>( 562 562 new details::callback8<R, 563 563 T1, T2, T3, T4, T5, T6, T7, T8>(f)), p); … … 572 572 { 573 573 add_function(name, 574 boost::shared_ptr<details::callback_base>(574 std::shared_ptr<details::callback_base>( 575 575 new details::callback9<R, 576 576 T1, T2, T3, T4, T5, T6, T7, T8, T9>(f)), p); … … 583 583 details::class_definer<C> class_(std::string const &name) 584 584 { 585 boost::shared_ptr<details::class_handler<C> > ch(585 std::shared_ptr<details::class_handler<C> > ch( 586 586 new details::class_handler<C>()); 587 587 … … 589 589 590 590 add_constructor(name, ch, 591 boost::shared_ptr<details::callback_base>(591 std::shared_ptr<details::callback_base>( 592 592 new details::callback0<C*>(&details::construct< 593 593 C, void, void, void, void, void, void, void, … … 608 608 callback_type; 609 609 610 boost::shared_ptr<details::class_handler<C> > ch(610 std::shared_ptr<details::class_handler<C> > ch( 611 611 new details::class_handler<C>()); 612 612 … … 614 614 615 615 add_constructor(name, ch, 616 boost::shared_ptr<details::callback_base>(616 std::shared_ptr<details::callback_base>( 617 617 new callback_type(&details::construct< 618 618 C, T1, T2, T3, T4, T5, T6, T7, T8, T9>::doit)), p); … … 625 625 std::string const &name, details::no_init_type const &) 626 626 { 627 boost::shared_ptr<details::class_handler<C> > ch(627 std::shared_ptr<details::class_handler<C> > ch( 628 628 new details::class_handler<C>()); 629 629 … … 660 660 661 661 void add_function(std::string const &name, 662 boost::shared_ptr<details::callback_base> cb,662 std::shared_ptr<details::callback_base> cb, 663 663 policies const &p = policies()); 664 664 665 665 void add_class(std::string const &name, 666 boost::shared_ptr<details::class_handler_base> chb);666 std::shared_ptr<details::class_handler_base> chb); 667 667 668 668 void add_constructor(std::string const &name, 669 boost::shared_ptr<details::class_handler_base> chb,670 boost::shared_ptr<details::callback_base> cb,669 std::shared_ptr<details::class_handler_base> chb, 670 std::shared_ptr<details::callback_base> cb, 671 671 policies const &p = policies()); 672 672
Note: See TracChangeset
for help on using the changeset viewer.