argument_holder.hh

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 #ifndef lestes__msg___argument_holder_hh___included
00029 #define lestes__msg___argument_holder_hh___included
00030 
00031 /*! \file
00032   \brief Message argument holders.
00033 
00034   Definition of classes holding stencil and arguments for message.
00035   Enables incremental building of message by adding individual arguments.
00036   \author pt
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   \brief Type convertor.
00048 
00049   Convertor from ptr to the equivalent srp type. General case for non-ptr types.
00050   The result of the conversion is the original type, availiable in ptr_to_srp::result.
00051   \param T  The type to convert.
00052 */
00053 template <typename T>
00054 struct ptr_to_srp {
00055         //! The resulting type of the conversion.
00056         typedef T result;
00057 };
00058 
00059 /*!
00060   \brief Type convertor.
00061 
00062   Convertor from ptr to the equivalent srp type.  Special case for ptr types.
00063   The result of the conversion is srp to the pointee type, availiable in ptr_to_srp::result.
00064   \param T  The pointee type of the ptr to convert.
00065 */
00066 template <typename T>
00067 struct ptr_to_srp< ptr<T> >
00068 {
00069         //! The resulting type of the conversion.
00070         typedef srp<T> result;
00071 };
00072 
00073 /*!
00074   \brief Object marker.
00075 
00076   Does nothing for simple types.
00077   \param T The simple type.
00078 */
00079 template <typename T>
00080 struct ptr_marker {
00081         //! Marks simple type.
00082         static void gc_mark(T &);
00083 };
00084 
00085 /*!
00086   Fallback method for simple types.
00087   Does no operation.
00088 */
00089 template <typename T>
00090 void ptr_marker<T>::gc_mark(T &) 
00091 {
00092 }
00093 
00094 /*!
00095   \brief Object marker.
00096 
00097   Marks the object pointed to by the ptr.
00098   FIXME: Add a comment why we use srp<> and not ptr<>.
00099   \param T The pointee type.
00100 */
00101 template <typename T>
00102 struct ptr_marker< ptr<T> > {
00103         //! Marks the ptr type.
00104         static void gc_mark(srp<T> &p);
00105 };
00106 
00107 /*!
00108   \brief Marks the object.
00109   
00110   Marks the object pointed to.
00111   \param p The object to mark.
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   \brief Argument holder.
00122 
00123   Holder for zero arguments with zero arguments filled.
00124   \param T  Fake argument to enable templatization.
00125 */
00126 template <typename T>
00127 class argument_holder00: public object {
00128 public:
00129         //! Type of the stencil.
00130         typedef ptr< message_stencil0<T> > stencil_type;
00131         //! Returns the stencil.
00132         stencil_type stencil_get(void) const;
00133         //! Returns the holder.
00134         static ptr< argument_holder00<T> > create(const stencil_type &a_stencil);
00135 protected:
00136         //! Creates the holder.
00137         argument_holder00(const stencil_type &a_stencil);
00138         //! Marks the object.
00139         void gc_mark(void);
00140 private:
00141         //! Stencil for the message.
00142         srp< message_stencil0<T> > stencil;
00143         //! Fake method to enable templatization.
00144         void fake_method(T &);
00145         //! Hides copy constructor.
00146         argument_holder00(const argument_holder00<T> &);
00147         //! Hides assignment operator.
00148         argument_holder00<T> &operator=(const argument_holder00<T> &);
00149 };
00150 
00151 /*!
00152   Creates holder for zero arguments.
00153   \param a_stencil  The stencil for the message.
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   Returns the stencil.
00163   \return The stored stencil.
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   Returns holder for no arguments.
00173   \pre a_stencil != NULL
00174   \param a_stencil  The stencil for the message.
00175   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00195 
00196   Holder for one argument with no arguments filled.
00197   \param P0  The type of the zeroth argument.
00198 */
00199 template <typename P0>
00200 class argument_holder10: public object {
00201 public:
00202         //! Type of the stencil.
00203         typedef ptr< message_stencil1<P0> > stencil_type;
00204         //! Returns the stencil.
00205         stencil_type stencil_get(void) const;
00206         //! Returns the holder.
00207         static ptr< argument_holder10<P0> > create(const stencil_type &a_stencil);
00208 protected:
00209         //! Creates the holder.
00210         argument_holder10(int, const stencil_type &a_stencil);
00211         //! Creates copy of the holder.
00212         argument_holder10(const ptr< argument_holder10<P0> > &other);
00213         //! Marks the object.
00214         void gc_mark(void);
00215 private:
00216         //! Stencil for the message.
00217         srp< message_stencil1<P0> > stencil;
00218         //! Hides copy constructor.
00219         argument_holder10(const argument_holder10<P0> &);
00220         //! Hides assignment operator.
00221         argument_holder10<P0> &operator=(const argument_holder10<P0> &);
00222 };
00223 
00224 /*!
00225   Creates the holder.
00226   \param a_stencil  The stencil for the message.
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   Creates the holder by copying other holder. 
00236   \param a_other  The holder to copy.
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   Returns the stencil.
00246   \return The stored stencil.
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   Returns the holder.
00256   \pre a_stencil != NULL
00257   \param a_stencil  The stencil for the message.
00258   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00278 
00279   Holder for one argument with one argument filled.
00280   \param P0  The type of the zeroth argument.
00281 */
00282 template <typename P0>
00283 class argument_holder11: public argument_holder10<P0> {
00284 public:
00285         // Type of the zeroth argument.
00286         typedef typename convert<P0>::to_ptr p0_type;
00287         //! Returns the zeroth argument.
00288         p0_type p0_get(void) const;
00289         //! Returns the holder.
00290         static ptr< argument_holder11<P0> > create(const ptr< argument_holder10<P0> > &parent, const p0_type &a_p0);
00291 protected:
00292         //! Creates the holder.
00293         argument_holder11(const ptr< argument_holder10<P0> > &parent, const P0 &a_p0);
00294         //! Marks the object.
00295         void gc_mark(void);
00296 private:
00297         //! The zeroth argument.
00298         typename convert<P0>::to_srp p0;
00299         //! Hides copy constructor.
00300         argument_holder11(const argument_holder11<P0> &);
00301         //! Hides assignment operator.
00302         argument_holder11<P0> &operator=(const argument_holder11<P0> &);
00303 };
00304 
00305 /*!
00306   Creates holder for one argument.
00307   \param a_parent  The parent of this holder.
00308   \param a_p0  The zeroth argument for the message.
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   Returns the zeroth argument.
00319   \return The zeroth argument.
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   Returns holder for one argument.
00329   \pre parent != NULL
00330   \param parent  The parent of this holder.
00331   \param a_p0  The zeroth argument for the message.
00332   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00352 
00353   Holder for two arguments with no arguments filled.
00354   \param P0  The type of the zeroth argument.
00355   \param P1  The type of the first argument.
00356 */
00357 template <typename P0, typename P1>
00358 class argument_holder20: public object {
00359 public:
00360         //! Type of the stencil.
00361         typedef ptr< message_stencil2<P0,P1> > stencil_type;
00362         //! Returns the stencil.
00363         stencil_type stencil_get(void) const;
00364         //! Returns the holder.
00365         static ptr< argument_holder20<P0,P1> > create(const stencil_type &a_stencil);
00366 protected:
00367         //! Creates the holder.
00368         argument_holder20(int, const stencil_type &a_stencil);
00369         //! Creates copy of the holder.
00370         argument_holder20(const ptr< argument_holder20<P0,P1> > &other);
00371         //! Marks the object.
00372         void gc_mark(void);
00373 private:
00374         //! Stencil for the message.
00375         srp< message_stencil2<P0,P1> > stencil;
00376         //! Hides copy constructor.
00377         argument_holder20(const argument_holder20<P0,P1> &);
00378         //! Hides assignment operator.
00379         argument_holder20<P0,P1> &operator=(const argument_holder20<P0,P1> &);
00380 };
00381 
00382 /*!
00383   Creates the holder for two arguments.
00384   \param a_stencil  The stencil for the message.
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   Creates holder by copying other holder. 
00394   \param a_other  The holder to copy.
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   Returns the stencil.
00404   \return The stored stencil.
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   Returns holder for two arguments.
00414   \pre a_stencil != NULL
00415   \param a_stencil  The stencil for the message.
00416   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00436 
00437   Holder for two arguments with one argument filled.
00438   \param P0  The type of the zeroth argument.
00439   \param P1  The type of the first argument.
00440 */
00441 template <typename P0, typename P1>
00442 class argument_holder21: public argument_holder20<P0,P1> {
00443 public:
00444         //! Type of the zeroth argument.
00445         typedef typename convert<P0>::to_ptr p0_type;
00446         //! Returns the zeroth argument.
00447         p0_type p0_get(void) const;
00448         //! Returns the holder.
00449         static ptr< argument_holder21<P0,P1> > create(const ptr< argument_holder20<P0,P1> >&parent, const p0_type &a_p0);
00450 protected:
00451         //! Creates the holder.
00452         argument_holder21(const ptr< argument_holder20<P0,P1> > &parent, const p0_type &a_p0);
00453         //! Creates a copy of the holder.
00454         argument_holder21(const ptr< argument_holder21<P0,P1> > &other);
00455         //! Marks the object.
00456         void gc_mark(void);
00457 private:
00458         //! The zeroth argument.
00459         typename convert<P0>::to_srp p0;
00460         //! Hides copy constructor.
00461         argument_holder21(const argument_holder21<P0,P1> &);
00462         //! Hides assignment operator.
00463         argument_holder21<P0,P1> &operator=(const argument_holder21<P0,P1> &);
00464 };
00465 
00466 /*!
00467   Creates the holder for two arguments.
00468   \param a_parent  The parent of this holder.
00469   \param a_p0  The zeroth argument for the message.
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   Creates the holder by copying other holder. 
00480   \param a_other  The holder to copy.
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   Returns the zeroth argument.
00491   \return The zeroth argument.
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   Returns the holder for two arguments.
00501   \pre parent != NULL
00502   \param parent  The parent of this holder.
00503   \param a_p0  The zeroth argument for the message.
00504   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00525 
00526   Holder for two arguments with two arguments filled.
00527   \param P0  The type of the zeroth argument.
00528   \param P1  The type of the first argument.
00529 */
00530 template <typename P0, typename P1>
00531 class argument_holder22: public argument_holder21<P0,P1> {
00532 public:
00533         //! Type of the first argument.
00534         typedef typename convert<P1>::to_ptr p1_type;
00535         //! Returns the first argument.
00536         p1_type p1_get(void) const;
00537         //! Returns the holder.
00538         static ptr< argument_holder22<P0,P1> > create(const ptr< argument_holder21<P0,P1> > &parent, const p1_type &a_p1);
00539 protected:
00540         //! Creates the holder.
00541         argument_holder22(const ptr< argument_holder21<P0,P1> > &parent, const p1_type &a_p1);
00542         //! Marks the object.
00543         void gc_mark(void);
00544 private:
00545         //! The first argument.
00546         typename convert<P1>::to_srp p1;
00547         //! Hides copy constructor.
00548         argument_holder22(const argument_holder22<P0,P1> &);
00549         //! Hides assignment operator.
00550         argument_holder22<P0,P1> &operator=(const argument_holder22<P0,P1> &);
00551 };
00552 
00553 /*!
00554   Creates the holder for two arguments.
00555   \param parent  The parent of this holder.
00556   \param a_p1  The first argument for the message.
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   Returns the first argument.
00567   \return The first argument.
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   Returns holder for two arguments.
00577   \pre a_parent != NULL
00578   \param a_parent  The parent of this holder.
00579   \param a_p1  The first argument for the message.
00580   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00601 
00602   Holder for three arguments with no arguments filled.
00603   \param P0  The type of the zeroth argument.
00604   \param P1  The type of the first argument.
00605   \param P2  The type of the second argument.
00606 */
00607 template <typename P0, typename P1, typename P2>
00608 class argument_holder30: public object {
00609 public:
00610         //! Type of the stencil.
00611         typedef ptr< message_stencil3<P0,P1,P2> > stencil_type;
00612         //! Returns the stencil.
00613         stencil_type stencil_get(void) const;
00614         //! Returns the holder.
00615         static ptr< argument_holder30<P0,P1,P2> > create(const stencil_type &a_stencil);
00616 protected:
00617         //! Creates the holder.
00618         argument_holder30(int, const stencil_type &a_stencil);
00619         //! Creates copy of the holder.
00620         argument_holder30(const ptr< argument_holder30<P0,P1,P2> > &other);
00621         //! Marks the object.
00622         void gc_mark(void);
00623 private:
00624         //! Stencil for the message.
00625         srp< message_stencil3<P0,P1,P2> > stencil;
00626         //! Hides copy constructor.
00627         argument_holder30(const argument_holder30<P0,P1,P2> &);
00628         //! Hides assignment operator.
00629         argument_holder30<P0,P1,P2> &operator=(const argument_holder30<P0,P1,P2> &);
00630 };
00631 
00632 /*!
00633   Creates the holder for three arguments.
00634   \param a_stencil  The stencil for the message.
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   Creates holder by copying other holder. 
00644   \param a_other  The holder to copy.
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   Returns the stencil.
00654   \return The stored stencil.
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   Returns holder for three arguments.
00664   \pre a_stencil != NULL
00665   \param a_stencil  The stencil for the message.
00666   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00686 
00687   Holder for three arguments with one argument filled.
00688   \param P0  The type of the zeroth argument.
00689   \param P1  The type of the first argument.
00690   \param P2  The type of the second argument.
00691 */
00692 template <typename P0, typename P1, typename P2>
00693 class argument_holder31: public argument_holder30<P0,P1,P2> {
00694 public:
00695         //! Type of the zeroth argument.
00696         typedef typename convert<P0>::to_ptr p0_type;
00697         //! Returns the zeroth argument.
00698         p0_type p0_get(void) const;
00699         //! Returns the holder.
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         //! Creates the holder.
00703         argument_holder31(const ptr< argument_holder30<P0,P1,P2> > &parent, const p0_type &a_p0);
00704         //! Creates a copy of the holder.
00705         argument_holder31(const ptr< argument_holder31<P0,P1,P2> > &other);
00706         //! Marks the object.
00707         void gc_mark(void);
00708 private:
00709         //! The zeroth argument.
00710         typename convert<P0>::to_srp p0;
00711         //! Hides copy constructor.
00712         argument_holder31(const argument_holder31<P0,P1,P2> &);
00713         //! Hides assignment operator.
00714         argument_holder31<P0,P1,P2> &operator=(const argument_holder31<P0,P1,P2> &);
00715 };
00716 
00717 /*!
00718   Creates the holder for three arguments.
00719   \pre a_parent != NULL
00720   \param a_parent  The parent of this holder.
00721   \param a_p0  The zeroth argument for the message.
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   Creates the holder by copying other holder.
00732   \pre a_other != NULL
00733   \param a_other  The holder to copy.
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   Returns the zeroth argument.
00744   \return The zeroth argument.
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   Returns the holder for three arguments.
00754   \pre parent != NULL
00755   \param parent  The parent of this holder.
00756   \param a_p0  The zeroth argument for the message.
00757   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00778 
00779   Holder for three arguments with two arguments filled.
00780   \param P0  The type of the zeroth argument.
00781   \param P1  The type of the first argument.
00782   \param P2  The type of the second argument.
00783 */
00784 template <typename P0, typename P1, typename P2>
00785 class argument_holder32: public argument_holder31<P0,P1,P2> {
00786 public:
00787         //! The type of the first argument.
00788         typedef typename convert<P1>::to_ptr p1_type;
00789         //! Returns the first argument.
00790         p1_type p1_get(void) const;
00791         //! Returns the holder.
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         //! Creates the holder.
00795         argument_holder32(const ptr< argument_holder31<P0,P1,P2> > &parent, const p1_type &a_p1);
00796         //! Creates a copy of the holder.
00797         argument_holder32(const ptr< argument_holder32<P0,P1,P2> > &other);
00798         //! Marks the object.
00799         void gc_mark(void);
00800 private:
00801         //! The first argument.
00802         typename convert<P1>::to_srp p1;
00803         //! Hides copy constructor.
00804         argument_holder32(const argument_holder32<P0,P1,P2> &);
00805         //! Hides assignment operator.
00806         argument_holder32<P0,P1,P2> &operator=(const argument_holder32<P0,P1,P2> &);
00807 };
00808 
00809 /*!
00810   Creates the holder for a one-argument message.
00811   \param parent  The parent of this holder.
00812   \param a_p1  The first argument for the message.
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   Creates the holder by copying other holder.
00823   \pre a_other != NULL
00824   \param a_other  The holder to copy.
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   Returns the first argument.
00835   \return The first argument.
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   Returns holder for two arguments.
00845   \pre a_parent != NULL
00846   \param a_parent  The parent of this holder.
00847   \param a_p1  The zeroth argument for the message.
00848   \return  The holder.
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   Marks the object for garbage collection.
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   \brief Argument holder.
00869 
00870   Holder for three arguments with three arguments filled.
00871   \param P0  The type of the zeroth argument.
00872   \param P1  The type of the first argument.
00873   \param P2  The type of the second argument.
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         //! Returns the second argument.
00880         p2_type p2_get(void) const;
00881         //! Returns the holder.
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         //! Creates the holder.
00885         argument_holder33(const ptr< argument_holder32<P0,P1,P2> > &parent, const p2_type &a_p2);
00886         //! Marks the object.
00887         void gc_mark(void);
00888 private:
00889         //! The second argument.
00890         typename convert<P2>::to_srp p2;
00891         //! Hides copy constructor.
00892         argument_holder33(const argument_holder33<P0,P1,P2> &);
00893         //! Hides assignment operator.
00894         argument_holder33<P0,P1,P2> &operator=(const argument_holder33<P0,P1,P2> &);
00895 };
00896 
00897 /*!
00898   Creates the holder for three argument message.
00899   \param parent  The parent of this holder.
00900   \param a_p2  The second argument for the message.
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   Returns the second argument.
00911   \return The second argument.
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   Returns holder for three arguments.
00921   \pre a_parent != NULL
00922   \param a_parent  The parent of this holder.
00923   \param a_p2  The second argument for the message.
00924   \return  The holder.
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   Marks the object for garbage collection.
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 /* vim: set ft=lestes : */

Generated on Mon Feb 12 18:22:11 2007 for lestes by doxygen 1.5.1-20070107