Array_VarOut_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Array_VarOut_T.h
00006  *
00007  *  Array_VarOut_T.h,v 1.30 2006/06/21 20:51:30 parsons Exp
00008  *
00009  *  @author Jeff Parsons
00010  *  @author Johnny Willemsen
00011  */
00012 //=============================================================================
00013 
00014 
00015 #ifndef TAO_ARRAY_VAROUT_T_H
00016 #define TAO_ARRAY_VAROUT_T_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00025 
00026 namespace TAO
00027 {
00028   /**
00029    * @struct Array_Traits
00030    *
00031    * @brief Specialized for each array in generated code.
00032    *
00033    */
00034   template<typename T_forany>
00035   struct Array_Traits;
00036 }
00037 
00038 /**
00039  * @class TAO_Array_Forany_T
00040  *
00041  * @brief Parametrized implementation of _forany class for arrays.
00042  *
00043  */
00044 template<typename T, typename T_slice, typename TAG>
00045 class TAO_Array_Forany_T
00046 {
00047 public:
00048   typedef T _array_type;
00049   typedef T_slice _slice_type;
00050 
00051   TAO_Array_Forany_T (void);
00052   TAO_Array_Forany_T (_slice_type *, CORBA::Boolean nocopy = false);
00053   TAO_Array_Forany_T (const TAO_Array_Forany_T<T,T_slice,TAG> &);
00054   ~TAO_Array_Forany_T (void);
00055 
00056   static void _tao_any_destructor (void *);
00057 
00058   TAO_Array_Forany_T & operator= (_slice_type *);
00059   TAO_Array_Forany_T & operator= (const TAO_Array_Forany_T<T,T_slice,TAG> &);
00060 
00061   _slice_type & operator[] (CORBA::ULong index);
00062   const _slice_type & operator[] (CORBA::ULong index) const;
00063 
00064   operator _slice_type * const & () const;
00065   operator _slice_type *& ();
00066 
00067   typedef const _slice_type *   _in_type;
00068   typedef       _slice_type *   _inout_type;
00069   typedef       _slice_type * & _out_type;
00070   typedef       _slice_type *   _retn_type;
00071   typedef       _slice_type *&  _retn_arg_type;
00072 
00073   // in, inout, out, _retn
00074   _in_type      in (void) const;
00075   _inout_type   inout (void);
00076   _out_type     out (void);
00077   _retn_type    _retn (void);
00078   _slice_type * ptr (void) const;
00079   CORBA::Boolean nocopy (void) const;
00080 
00081   static _slice_type * tao_alloc (void);
00082 private:
00083   typedef TAO_Array_Forany_T<T,T_slice,TAG> FORANY;
00084   _slice_type * ptr_;
00085   CORBA::Boolean nocopy_;
00086 };
00087 
00088 /**
00089  * @class TAO_Array_Var_Base_T
00090  *
00091  * @brief Parametrized implementation of _var base class for arrays.
00092  *
00093  */
00094 template<typename T, typename T_slice, typename TAG>
00095 class TAO_Array_Var_Base_T
00096 {
00097 public:
00098   typedef T_slice _slice_type;
00099   typedef T_slice  const & _const_subscript_type;
00100   typedef T_slice  & _subscript_type;
00101 
00102   TAO_Array_Var_Base_T (void);
00103   TAO_Array_Var_Base_T (_slice_type *);
00104   TAO_Array_Var_Base_T (const TAO_Array_Var_Base_T<T,T_slice,TAG> &);
00105   ~TAO_Array_Var_Base_T (void);
00106 
00107   _subscript_type operator[] (CORBA::ULong index);
00108   _const_subscript_type operator[] (CORBA::ULong index) const;
00109   operator _slice_type * const & () const;
00110 
00111   typedef const _slice_type *   _in_type;
00112   typedef       _slice_type *   _inout_type;
00113   typedef       _slice_type *   _retn_type;
00114   typedef       _slice_type *&  _retn_arg_type;
00115 
00116   // in, inout, out, _retn
00117   _in_type      in (void) const;
00118   _inout_type   inout (void);
00119   _retn_type    _retn (void);
00120   _retn_arg_type  _retn_arg (void);
00121 
00122   // TAO extension.
00123   _retn_type    ptr (void) const;
00124 protected:
00125   typedef TAO_Array_Forany_T<T,T_slice,TAG> FORANY;
00126   _slice_type * ptr_;
00127 };
00128 
00129 /**
00130  * @class TAO_FixedArray_Var_T
00131  *
00132  * @brief Parametrized implementation of _var class for arrays with
00133  * elements of fixed size.
00134  *
00135  */
00136 template<typename T, typename T_slice, typename TAG>
00137 class TAO_FixedArray_Var_T : public TAO_Array_Var_Base_T<T,T_slice,TAG>
00138 {
00139 public:
00140   typedef T_slice _slice_type;
00141   typedef T_slice *_out_type;
00142 
00143   TAO_FixedArray_Var_T (void);
00144   TAO_FixedArray_Var_T (_slice_type *);
00145   TAO_FixedArray_Var_T (const TAO_FixedArray_Var_T<T,T_slice,TAG> &);
00146 
00147   TAO_FixedArray_Var_T<T,T_slice,TAG> &operator= (_slice_type *);
00148   TAO_FixedArray_Var_T<T,T_slice,TAG> &operator= (
00149       const TAO_FixedArray_Var_T<T,T_slice,TAG> &
00150     );
00151 
00152   _out_type     out (void);
00153   
00154 private:
00155   // Some compilers don't look into the base class when parsing
00156   // templates unless they are force to.
00157   typedef typename TAO_Array_Var_Base_T<T,T_slice,TAG>::FORANY FORANY;
00158 };
00159 
00160 /**
00161  * @class TAO_VarArray_Var_T
00162  *
00163  * @brief Parametrized implementation of _var class for arrays with
00164  * elements of variable size.
00165  *
00166  */
00167 template<typename T, typename T_slice, typename TAG>
00168 class TAO_VarArray_Var_T : public TAO_Array_Var_Base_T<T,T_slice,TAG>
00169 {
00170 public:
00171   typedef T_slice _slice_type;
00172   typedef T_slice *&_out_type;
00173 
00174   TAO_VarArray_Var_T (void);
00175   TAO_VarArray_Var_T (_slice_type *);
00176   TAO_VarArray_Var_T (const TAO_VarArray_Var_T<T,T_slice,TAG> &);
00177 
00178   TAO_VarArray_Var_T<T,T_slice,TAG> &operator= (_slice_type *);
00179   TAO_VarArray_Var_T<T,T_slice,TAG> &operator= (
00180       const TAO_VarArray_Var_T<T,T_slice,TAG> &
00181     );
00182 
00183   _out_type     out (void);
00184 
00185   operator _slice_type *& ();
00186   
00187 private:
00188   // Some compilers don't look into the base class when parsing
00189   // templates unless they are force to.
00190   typedef typename TAO_Array_Var_Base_T<T,T_slice,TAG>::FORANY FORANY;
00191 };
00192 
00193 /**
00194  * @class TAO_Array_Out_T
00195  *
00196  * @brief Parametrized implementation of _out class for arrays.
00197  *
00198  */
00199 template<typename T, typename T_var, typename T_slice, typename TAG>
00200 class TAO_Array_Out_T
00201 {
00202 public:
00203   typedef T_slice _slice_type;
00204   typedef T_var _value_type;
00205   typedef T_var _var_type;
00206 
00207   TAO_Array_Out_T (_slice_type *&);
00208   TAO_Array_Out_T (_value_type &);
00209   TAO_Array_Out_T (const TAO_Array_Out_T<T,T_var,T_slice,TAG> &);
00210 
00211   TAO_Array_Out_T<T,T_var,T_slice,TAG> &operator= (
00212       const TAO_Array_Out_T<T,T_var,T_slice,TAG> &
00213     );
00214   TAO_Array_Out_T<T,T_var,T_slice,TAG> &operator= (_slice_type *);
00215 
00216   operator _slice_type *& ();
00217   _slice_type *& ptr (void);
00218 
00219   _slice_type & operator[] (CORBA::ULong index);
00220   const _slice_type & operator[] (CORBA::ULong index) const;
00221 private:
00222   typedef TAO_Array_Forany_T<T,T_slice,TAG> FORANY;
00223   typedef TAO_Array_Out_T<T,T_var,T_slice,TAG> THIS_OUT_TYPE;
00224   _slice_type *& ptr_;
00225 
00226   // Assignment from T_var not allowed.
00227   void operator= (const _value_type &);
00228 };
00229 
00230 TAO_END_VERSIONED_NAMESPACE_DECL
00231 
00232 #if defined (__ACE_INLINE__)
00233 #include "tao/Array_VarOut_T.inl"
00234 #endif /* __ACE_INLINE__ */
00235 
00236 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00237 #include "tao/Array_VarOut_T.cpp"
00238 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00239 
00240 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00241 #pragma implementation ("Array_VarOut_T.cpp")
00242 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00243 
00244 #include /**/ "ace/post.h"
00245 
00246 #endif /* TAO_ARRAY_VAROUT_T_H */

Generated on Thu Nov 9 11:54:07 2006 for TAO by doxygen 1.3.6