00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef lestes__msg___argument_holder_hh___included
00029 #define lestes__msg___argument_holder_hh___included
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <lestes/common.hh>
00039 #include <lestes/pointer_helpers.hh>
00040 #include <lestes/msg/message_stencil.hh>
00041
00042 package(lestes);
00043 package(msg);
00044
00045 #if 0
00046
00047
00048
00049
00050
00051
00052
00053 template <typename T>
00054 struct ptr_to_srp {
00055
00056 typedef T result;
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066 template <typename T>
00067 struct ptr_to_srp< ptr<T> >
00068 {
00069
00070 typedef srp<T> result;
00071 };
00072
00073
00074
00075
00076
00077
00078
00079 template <typename T>
00080 struct ptr_marker {
00081
00082 static void gc_mark(T &);
00083 };
00084
00085
00086
00087
00088
00089 template <typename T>
00090 void ptr_marker<T>::gc_mark(T &)
00091 {
00092 }
00093
00094
00095
00096
00097
00098
00099
00100
00101 template <typename T>
00102 struct ptr_marker< ptr<T> > {
00103
00104 static void gc_mark(srp<T> &p);
00105 };
00106
00107
00108
00109
00110
00111
00112
00113 template <typename T>
00114 void ptr_marker< ptr<T> >::gc_mark(srp<T> &p)
00115 {
00116 p.gc_mark();
00117 }
00118 #endif
00119
00120
00121
00122
00123
00124
00125
00126 template <typename T>
00127 class argument_holder00: public object {
00128 public:
00129
00130 typedef ptr< message_stencil0<T> > stencil_type;
00131
00132 stencil_type stencil_get(void) const;
00133
00134 static ptr< argument_holder00<T> > create(const stencil_type &a_stencil);
00135 protected:
00136
00137 argument_holder00(const stencil_type &a_stencil);
00138
00139 void gc_mark(void);
00140 private:
00141
00142 srp< message_stencil0<T> > stencil;
00143
00144 void fake_method(T &);
00145
00146 argument_holder00(const argument_holder00<T> &);
00147
00148 argument_holder00<T> &operator=(const argument_holder00<T> &);
00149 };
00150
00151
00152
00153
00154
00155 template <typename T>
00156 argument_holder00<T>::argument_holder00(const stencil_type &a_stencil):
00157 stencil(checked(a_stencil))
00158 {
00159 }
00160
00161
00162
00163
00164
00165 template <typename T>
00166 typename argument_holder00<T>::stencil_type argument_holder00<T>::stencil_get(void) const
00167 {
00168 return stencil;
00169 }
00170
00171
00172
00173
00174
00175
00176
00177 template <typename T>
00178 ptr< argument_holder00<T> > argument_holder00<T>::create(const stencil_type &a_stencil)
00179 {
00180 return new argument_holder00<T>(a_stencil);
00181 }
00182
00183
00184
00185
00186 template <typename T>
00187 void argument_holder00<T>::gc_mark(void)
00188 {
00189 stencil.gc_mark();
00190 object::gc_mark();
00191 }
00192
00193
00194
00195
00196
00197
00198
00199 template <typename P0>
00200 class argument_holder10: public object {
00201 public:
00202
00203 typedef ptr< message_stencil1<P0> > stencil_type;
00204
00205 stencil_type stencil_get(void) const;
00206
00207 static ptr< argument_holder10<P0> > create(const stencil_type &a_stencil);
00208 protected:
00209
00210 argument_holder10(int, const stencil_type &a_stencil);
00211
00212 argument_holder10(const ptr< argument_holder10<P0> > &other);
00213
00214 void gc_mark(void);
00215 private:
00216
00217 srp< message_stencil1<P0> > stencil;
00218
00219 argument_holder10(const argument_holder10<P0> &);
00220
00221 argument_holder10<P0> &operator=(const argument_holder10<P0> &);
00222 };
00223
00224
00225
00226
00227
00228 template <typename P0>
00229 argument_holder10<P0>::argument_holder10(int, const stencil_type &a_stencil):
00230 stencil(checked(a_stencil))
00231 {
00232 }
00233
00234
00235
00236
00237
00238 template <typename P0>
00239 argument_holder10<P0>::argument_holder10(const ptr< argument_holder10<P0> > &other):
00240 stencil(((void)checked(other),other->stencil_get()))
00241 {
00242 }
00243
00244
00245
00246
00247
00248 template <typename P0>
00249 typename argument_holder10<P0>::stencil_type argument_holder10<P0>::stencil_get(void) const
00250 {
00251 return stencil;
00252 }
00253
00254
00255
00256
00257
00258
00259
00260 template <typename P0>
00261 ptr< argument_holder10<P0> > argument_holder10<P0>::create(const stencil_type &a_stencil)
00262 {
00263 return new argument_holder10<P0>(0,a_stencil);
00264 }
00265
00266
00267
00268
00269 template <typename P0>
00270 void argument_holder10<P0>::gc_mark(void)
00271 {
00272 stencil.gc_mark();
00273 object::gc_mark();
00274 }
00275
00276
00277
00278
00279
00280
00281
00282 template <typename P0>
00283 class argument_holder11: public argument_holder10<P0> {
00284 public:
00285
00286 typedef typename convert<P0>::to_ptr p0_type;
00287
00288 p0_type p0_get(void) const;
00289
00290 static ptr< argument_holder11<P0> > create(const ptr< argument_holder10<P0> > &parent, const p0_type &a_p0);
00291 protected:
00292
00293 argument_holder11(const ptr< argument_holder10<P0> > &parent, const P0 &a_p0);
00294
00295 void gc_mark(void);
00296 private:
00297
00298 typename convert<P0>::to_srp p0;
00299
00300 argument_holder11(const argument_holder11<P0> &);
00301
00302 argument_holder11<P0> &operator=(const argument_holder11<P0> &);
00303 };
00304
00305
00306
00307
00308
00309
00310 template <typename P0>
00311 argument_holder11<P0>::argument_holder11(const ptr< argument_holder10<P0> > &parent, const P0 &a_p0):
00312 argument_holder10<P0>(checked(parent)),
00313 p0(a_p0)
00314 {
00315 }
00316
00317
00318
00319
00320
00321 template <typename P0>
00322 typename argument_holder11<P0>::p0_type argument_holder11<P0>::p0_get(void) const
00323 {
00324 return p0;
00325 }
00326
00327
00328
00329
00330
00331
00332
00333
00334 template <typename P0>
00335 ptr< argument_holder11<P0> > argument_holder11<P0>::create(const ptr< argument_holder10<P0> > &parent, const p0_type &a_p0)
00336 {
00337 return new argument_holder11<P0>(parent,a_p0);
00338 }
00339
00340
00341
00342
00343 template <typename P0>
00344 void argument_holder11<P0>::gc_mark(void)
00345 {
00346 gc_mark_srp(p0);
00347 argument_holder10<P0>::gc_mark();
00348 }
00349
00350
00351
00352
00353
00354
00355
00356
00357 template <typename P0, typename P1>
00358 class argument_holder20: public object {
00359 public:
00360
00361 typedef ptr< message_stencil2<P0,P1> > stencil_type;
00362
00363 stencil_type stencil_get(void) const;
00364
00365 static ptr< argument_holder20<P0,P1> > create(const stencil_type &a_stencil);
00366 protected:
00367
00368 argument_holder20(int, const stencil_type &a_stencil);
00369
00370 argument_holder20(const ptr< argument_holder20<P0,P1> > &other);
00371
00372 void gc_mark(void);
00373 private:
00374
00375 srp< message_stencil2<P0,P1> > stencil;
00376
00377 argument_holder20(const argument_holder20<P0,P1> &);
00378
00379 argument_holder20<P0,P1> &operator=(const argument_holder20<P0,P1> &);
00380 };
00381
00382
00383
00384
00385
00386 template <typename P0, typename P1>
00387 argument_holder20<P0,P1>::argument_holder20(int, const stencil_type &a_stencil):
00388 stencil(checked(a_stencil))
00389 {
00390 }
00391
00392
00393
00394
00395
00396 template <typename P0, typename P1>
00397 argument_holder20<P0,P1>::argument_holder20(const ptr< argument_holder20<P0,P1> > &other):
00398 stencil(((void)checked(other),other->stencil_get()))
00399 {
00400 }
00401
00402
00403
00404
00405
00406 template <typename P0, typename P1>
00407 typename argument_holder20<P0,P1>::stencil_type argument_holder20<P0,P1>::stencil_get(void) const
00408 {
00409 return stencil;
00410 }
00411
00412
00413
00414
00415
00416
00417
00418 template <typename P0, typename P1>
00419 ptr< argument_holder20<P0,P1> > argument_holder20<P0,P1>::create(const stencil_type &a_stencil)
00420 {
00421 return new argument_holder20<P0,P1>(0,a_stencil);
00422 }
00423
00424
00425
00426
00427 template <typename P0, typename P1>
00428 void argument_holder20<P0,P1>::gc_mark(void)
00429 {
00430 stencil.gc_mark();
00431 object::gc_mark();
00432 }
00433
00434
00435
00436
00437
00438
00439
00440
00441 template <typename P0, typename P1>
00442 class argument_holder21: public argument_holder20<P0,P1> {
00443 public:
00444
00445 typedef typename convert<P0>::to_ptr p0_type;
00446
00447 p0_type p0_get(void) const;
00448
00449 static ptr< argument_holder21<P0,P1> > create(const ptr< argument_holder20<P0,P1> >&parent, const p0_type &a_p0);
00450 protected:
00451
00452 argument_holder21(const ptr< argument_holder20<P0,P1> > &parent, const p0_type &a_p0);
00453
00454 argument_holder21(const ptr< argument_holder21<P0,P1> > &other);
00455
00456 void gc_mark(void);
00457 private:
00458
00459 typename convert<P0>::to_srp p0;
00460
00461 argument_holder21(const argument_holder21<P0,P1> &);
00462
00463 argument_holder21<P0,P1> &operator=(const argument_holder21<P0,P1> &);
00464 };
00465
00466
00467
00468
00469
00470
00471 template <typename P0, typename P1>
00472 argument_holder21<P0,P1>::argument_holder21(const ptr< argument_holder20<P0,P1> > &parent, const p0_type &a_p0):
00473 argument_holder20<P0,P1>(checked(parent)),
00474 p0(a_p0)
00475 {
00476 }
00477
00478
00479
00480
00481
00482 template <typename P0, typename P1>
00483 argument_holder21<P0,P1>::argument_holder21(const ptr< argument_holder21<P0,P1> > &other):
00484 argument_holder20<P0,P1>(checked(other)),
00485 p0(other->p0_get())
00486 {
00487 }
00488
00489
00490
00491
00492
00493 template <typename P0, typename P1>
00494 typename argument_holder21<P0,P1>::p0_type argument_holder21<P0,P1>::p0_get(void) const
00495 {
00496 return p0;
00497 }
00498
00499
00500
00501
00502
00503
00504
00505
00506 template <typename P0, typename P1>
00507 ptr< argument_holder21<P0,P1> > argument_holder21<P0,P1>::create(const ptr< argument_holder20<P0,P1> > &parent,
00508 const p0_type &a_p0)
00509 {
00510 return new argument_holder21<P0,P1>(parent,a_p0);
00511 }
00512
00513
00514
00515
00516 template <typename P0, typename P1>
00517 void argument_holder21<P0,P1>::gc_mark(void)
00518 {
00519 gc_mark_srp(p0);
00520 argument_holder20<P0,P1>::gc_mark();
00521 }
00522
00523
00524
00525
00526
00527
00528
00529
00530 template <typename P0, typename P1>
00531 class argument_holder22: public argument_holder21<P0,P1> {
00532 public:
00533
00534 typedef typename convert<P1>::to_ptr p1_type;
00535
00536 p1_type p1_get(void) const;
00537
00538 static ptr< argument_holder22<P0,P1> > create(const ptr< argument_holder21<P0,P1> > &parent, const p1_type &a_p1);
00539 protected:
00540
00541 argument_holder22(const ptr< argument_holder21<P0,P1> > &parent, const p1_type &a_p1);
00542
00543 void gc_mark(void);
00544 private:
00545
00546 typename convert<P1>::to_srp p1;
00547
00548 argument_holder22(const argument_holder22<P0,P1> &);
00549
00550 argument_holder22<P0,P1> &operator=(const argument_holder22<P0,P1> &);
00551 };
00552
00553
00554
00555
00556
00557
00558 template <typename P0, typename P1>
00559 argument_holder22<P0,P1>::argument_holder22(const ptr< argument_holder21<P0,P1> > &parent, const p1_type &a_p1):
00560 argument_holder21<P0,P1>(checked(parent)),
00561 p1(a_p1)
00562 {
00563 }
00564
00565
00566
00567
00568
00569 template <typename P0, typename P1>
00570 typename argument_holder22<P0,P1>::p1_type argument_holder22<P0,P1>::p1_get(void) const
00571 {
00572 return p1;
00573 }
00574
00575
00576
00577
00578
00579
00580
00581
00582 template <typename P0, typename P1>
00583 ptr< argument_holder22<P0,P1> > argument_holder22<P0,P1>::create(const ptr< argument_holder21<P0,P1> > &parent,
00584 const p1_type &a_p1)
00585 {
00586 return new argument_holder22<P0,P1>(parent,a_p1);
00587 }
00588
00589
00590
00591
00592 template <typename P0, typename P1>
00593 void argument_holder22<P0,P1>::gc_mark(void)
00594 {
00595 gc_mark_srp(p1);
00596 argument_holder21<P0,P1>::gc_mark();
00597 }
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607 template <typename P0, typename P1, typename P2>
00608 class argument_holder30: public object {
00609 public:
00610
00611 typedef ptr< message_stencil3<P0,P1,P2> > stencil_type;
00612
00613 stencil_type stencil_get(void) const;
00614
00615 static ptr< argument_holder30<P0,P1,P2> > create(const stencil_type &a_stencil);
00616 protected:
00617
00618 argument_holder30(int, const stencil_type &a_stencil);
00619
00620 argument_holder30(const ptr< argument_holder30<P0,P1,P2> > &other);
00621
00622 void gc_mark(void);
00623 private:
00624
00625 srp< message_stencil3<P0,P1,P2> > stencil;
00626
00627 argument_holder30(const argument_holder30<P0,P1,P2> &);
00628
00629 argument_holder30<P0,P1,P2> &operator=(const argument_holder30<P0,P1,P2> &);
00630 };
00631
00632
00633
00634
00635
00636 template <typename P0, typename P1, typename P2>
00637 argument_holder30<P0,P1,P2>::argument_holder30(int, const stencil_type &a_stencil):
00638 stencil(checked(a_stencil))
00639 {
00640 }
00641
00642
00643
00644
00645
00646 template <typename P0, typename P1, typename P2>
00647 argument_holder30<P0,P1,P2>::argument_holder30(const ptr< argument_holder30<P0,P1,P2> > &other):
00648 stencil(((void)checked(other),other->stencil_get()))
00649 {
00650 }
00651
00652
00653
00654
00655
00656 template <typename P0, typename P1, typename P2>
00657 typename argument_holder30<P0,P1,P2>::stencil_type argument_holder30<P0,P1,P2>::stencil_get(void) const
00658 {
00659 return stencil;
00660 }
00661
00662
00663
00664
00665
00666
00667
00668 template <typename P0, typename P1, typename P2>
00669 ptr< argument_holder30<P0,P1,P2> > argument_holder30<P0,P1,P2>::create(const stencil_type &a_stencil)
00670 {
00671 return new argument_holder30<P0,P1,P2>(0,a_stencil);
00672 }
00673
00674
00675
00676
00677 template <typename P0, typename P1, typename P2>
00678 void argument_holder30<P0,P1,P2>::gc_mark(void)
00679 {
00680 stencil.gc_mark();
00681 object::gc_mark();
00682 }
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692 template <typename P0, typename P1, typename P2>
00693 class argument_holder31: public argument_holder30<P0,P1,P2> {
00694 public:
00695
00696 typedef typename convert<P0>::to_ptr p0_type;
00697
00698 p0_type p0_get(void) const;
00699
00700 static ptr< argument_holder31<P0,P1,P2> > create(const ptr< argument_holder30<P0,P1,P2> >&parent, const p0_type &a_p0);
00701 protected:
00702
00703 argument_holder31(const ptr< argument_holder30<P0,P1,P2> > &parent, const p0_type &a_p0);
00704
00705 argument_holder31(const ptr< argument_holder31<P0,P1,P2> > &other);
00706
00707 void gc_mark(void);
00708 private:
00709
00710 typename convert<P0>::to_srp p0;
00711
00712 argument_holder31(const argument_holder31<P0,P1,P2> &);
00713
00714 argument_holder31<P0,P1,P2> &operator=(const argument_holder31<P0,P1,P2> &);
00715 };
00716
00717
00718
00719
00720
00721
00722
00723 template <typename P0, typename P1, typename P2>
00724 argument_holder31<P0,P1,P2>::argument_holder31(const ptr< argument_holder30<P0,P1,P2> > &parent, const p0_type &a_p0):
00725 argument_holder30<P0,P1,P2>(checked(parent)),
00726 p0(a_p0)
00727 {
00728 }
00729
00730
00731
00732
00733
00734
00735 template <typename P0, typename P1, typename P2>
00736 argument_holder31<P0,P1,P2>::argument_holder31(const ptr< argument_holder31<P0,P1,P2> > &other):
00737 argument_holder30<P0,P1,P2>(checked(other)),
00738 p0(other->p0_get())
00739 {
00740 }
00741
00742
00743
00744
00745
00746 template <typename P0, typename P1, typename P2>
00747 typename argument_holder31<P0,P1,P2>::p0_type argument_holder31<P0,P1,P2>::p0_get(void) const
00748 {
00749 return p0;
00750 }
00751
00752
00753
00754
00755
00756
00757
00758
00759 template <typename P0, typename P1, typename P2>
00760 ptr< argument_holder31<P0,P1,P2> > argument_holder31<P0,P1,P2>::create(const ptr< argument_holder30<P0,P1,P2> > &parent,
00761 const p0_type &a_p0)
00762 {
00763 return new argument_holder31<P0,P1,P2>(parent,a_p0);
00764 }
00765
00766
00767
00768
00769 template <typename P0, typename P1, typename P2>
00770 void argument_holder31<P0,P1,P2>::gc_mark(void)
00771 {
00772 gc_mark_srp(p0);
00773 argument_holder30<P0,P1,P2>::gc_mark();
00774 }
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784 template <typename P0, typename P1, typename P2>
00785 class argument_holder32: public argument_holder31<P0,P1,P2> {
00786 public:
00787
00788 typedef typename convert<P1>::to_ptr p1_type;
00789
00790 p1_type p1_get(void) const;
00791
00792 static ptr< argument_holder32<P0,P1,P2> > create(const ptr< argument_holder31<P0,P1,P2> > &parent, const p1_type &a_p1);
00793 protected:
00794
00795 argument_holder32(const ptr< argument_holder31<P0,P1,P2> > &parent, const p1_type &a_p1);
00796
00797 argument_holder32(const ptr< argument_holder32<P0,P1,P2> > &other);
00798
00799 void gc_mark(void);
00800 private:
00801
00802 typename convert<P1>::to_srp p1;
00803
00804 argument_holder32(const argument_holder32<P0,P1,P2> &);
00805
00806 argument_holder32<P0,P1,P2> &operator=(const argument_holder32<P0,P1,P2> &);
00807 };
00808
00809
00810
00811
00812
00813
00814 template <typename P0, typename P1, typename P2>
00815 argument_holder32<P0,P1,P2>::argument_holder32(const ptr< argument_holder31<P0,P1,P2> > &parent, const p1_type &a_p1):
00816 argument_holder31<P0,P1,P2>(checked(parent)),
00817 p1(a_p1)
00818 {
00819 }
00820
00821
00822
00823
00824
00825
00826 template <typename P0, typename P1, typename P2>
00827 argument_holder32<P0,P1,P2>::argument_holder32(const ptr< argument_holder32<P0,P1,P2> > &other):
00828 argument_holder31<P0,P1,P2>(checked(other)),
00829 p1(other->p1_get())
00830 {
00831 }
00832
00833
00834
00835
00836
00837 template <typename P0, typename P1, typename P2>
00838 typename argument_holder32<P0,P1,P2>::p1_type argument_holder32<P0,P1,P2>::p1_get(void) const
00839 {
00840 return p1;
00841 }
00842
00843
00844
00845
00846
00847
00848
00849
00850 template <typename P0, typename P1, typename P2>
00851 ptr< argument_holder32<P0,P1,P2> > argument_holder32<P0,P1,P2>::create(const ptr< argument_holder31<P0,P1,P2> > &parent,
00852 const p1_type &a_p1)
00853 {
00854 return new argument_holder32<P0,P1,P2>(parent,a_p1);
00855 }
00856
00857
00858
00859
00860 template <typename P0, typename P1, typename P2>
00861 void argument_holder32<P0,P1,P2>::gc_mark(void)
00862 {
00863 gc_mark_srp(p1);
00864 argument_holder31<P0,P1,P2>::gc_mark();
00865 }
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875 template <typename P0, typename P1, typename P2>
00876 class argument_holder33: public argument_holder32<P0,P1,P2> {
00877 public:
00878 typedef typename convert<P2>::to_ptr p2_type;
00879
00880 p2_type p2_get(void) const;
00881
00882 static ptr< argument_holder33<P0,P1,P2> > create(const ptr< argument_holder32<P0,P1,P2> > &parent, const p2_type &a_p2);
00883 protected:
00884
00885 argument_holder33(const ptr< argument_holder32<P0,P1,P2> > &parent, const p2_type &a_p2);
00886
00887 void gc_mark(void);
00888 private:
00889
00890 typename convert<P2>::to_srp p2;
00891
00892 argument_holder33(const argument_holder33<P0,P1,P2> &);
00893
00894 argument_holder33<P0,P1,P2> &operator=(const argument_holder33<P0,P1,P2> &);
00895 };
00896
00897
00898
00899
00900
00901
00902 template <typename P0, typename P1, typename P2>
00903 argument_holder33<P0,P1,P2>::argument_holder33(const ptr< argument_holder32<P0,P1,P2> > &parent, const p2_type &a_p2):
00904 argument_holder32<P0,P1,P2>(checked(parent)),
00905 p2(a_p2)
00906 {
00907 }
00908
00909
00910
00911
00912
00913 template <typename P0, typename P1, typename P2>
00914 typename argument_holder33<P0,P1,P2>::p2_type argument_holder33<P0,P1,P2>::p2_get(void) const
00915 {
00916 return p2;
00917 }
00918
00919
00920
00921
00922
00923
00924
00925
00926 template <typename P0, typename P1, typename P2>
00927 ptr< argument_holder33<P0,P1,P2> > argument_holder33<P0,P1,P2>::create(const ptr< argument_holder32<P0,P1,P2> > &parent,
00928 const p2_type &a_p2)
00929 {
00930 return new argument_holder33<P0,P1,P2>(parent,a_p2);
00931 }
00932
00933
00934
00935
00936 template <typename P0, typename P1, typename P2>
00937 void argument_holder33<P0,P1,P2>::gc_mark(void)
00938 {
00939 gc_mark_srp(p2);
00940 argument_holder32<P0,P1,P2>::gc_mark();
00941 }
00942
00943 end_package(msg);
00944 end_package(lestes);
00945 #endif
00946