00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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 #include "tao/Versioned_Namespace.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 #include "tao/Basic_Types.h"
00027
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030 namespace TAO
00031 {
00032
00033
00034
00035
00036
00037
00038 template<typename T_forany>
00039 struct Array_Traits;
00040 }
00041
00042
00043
00044
00045
00046
00047
00048 template<typename T, typename T_slice, typename TAG>
00049 class TAO_Array_Forany_T
00050 {
00051 public:
00052 typedef T _array_type;
00053 typedef T_slice _slice_type;
00054 typedef TAG _tag_type;
00055
00056 TAO_Array_Forany_T (void);
00057 TAO_Array_Forany_T (_slice_type *, CORBA::Boolean nocopy = false);
00058 TAO_Array_Forany_T (const TAO_Array_Forany_T<T,T_slice,TAG> &);
00059 ~TAO_Array_Forany_T (void);
00060
00061 static void _tao_any_destructor (void *);
00062
00063 TAO_Array_Forany_T & operator= (_slice_type *);
00064 TAO_Array_Forany_T & operator= (const TAO_Array_Forany_T<T,T_slice,TAG> &);
00065
00066 _slice_type & operator[] (CORBA::ULong index);
00067 const _slice_type & operator[] (CORBA::ULong index) const;
00068
00069 operator _slice_type * const & () const;
00070 operator _slice_type *& ();
00071
00072 typedef const _slice_type * _in_type;
00073 typedef _slice_type * _inout_type;
00074 typedef _slice_type * & _out_type;
00075 typedef _slice_type * _retn_type;
00076 typedef _slice_type *& _retn_arg_type;
00077
00078
00079 _in_type in (void) const;
00080 _inout_type inout (void);
00081 _out_type out (void);
00082 _retn_type _retn (void);
00083 _slice_type * ptr (void) const;
00084 CORBA::Boolean nocopy (void) const;
00085
00086 static _slice_type * tao_alloc (void);
00087 private:
00088 typedef TAO_Array_Forany_T<T,T_slice,TAG> FORANY;
00089 _slice_type * ptr_;
00090 CORBA::Boolean nocopy_;
00091 };
00092
00093
00094
00095
00096
00097
00098
00099 template<typename T, typename T_slice, typename TAG>
00100 class TAO_Array_Var_Base_T
00101 {
00102 public:
00103 typedef T_slice _slice_type;
00104 typedef T_slice const & _const_subscript_type;
00105 typedef T_slice & _subscript_type;
00106
00107 TAO_Array_Var_Base_T (void);
00108 TAO_Array_Var_Base_T (_slice_type *);
00109 TAO_Array_Var_Base_T (const TAO_Array_Var_Base_T<T,T_slice,TAG> &);
00110 ~TAO_Array_Var_Base_T (void);
00111
00112 _subscript_type operator[] (CORBA::ULong index);
00113 _const_subscript_type operator[] (CORBA::ULong index) const;
00114 operator _slice_type * const & () const;
00115
00116 typedef const _slice_type * _in_type;
00117 typedef _slice_type * _inout_type;
00118 typedef _slice_type * _retn_type;
00119 typedef _slice_type *& _retn_arg_type;
00120
00121
00122 _in_type in (void) const;
00123 _inout_type inout (void);
00124 _retn_type _retn (void);
00125 _retn_arg_type _retn_arg (void);
00126
00127
00128 _retn_type ptr (void) const;
00129 protected:
00130 typedef TAO_Array_Forany_T<T,T_slice,TAG> FORANY;
00131 _slice_type * ptr_;
00132 };
00133
00134
00135
00136
00137
00138
00139
00140
00141 template<typename T, typename T_slice, typename TAG>
00142 class TAO_FixedArray_Var_T : public TAO_Array_Var_Base_T<T,T_slice,TAG>
00143 {
00144 public:
00145 typedef T_slice _slice_type;
00146 typedef T_slice *_out_type;
00147
00148 TAO_FixedArray_Var_T (void);
00149 TAO_FixedArray_Var_T (_slice_type *);
00150 TAO_FixedArray_Var_T (const TAO_FixedArray_Var_T<T,T_slice,TAG> &);
00151
00152 TAO_FixedArray_Var_T<T,T_slice,TAG> &operator= (_slice_type *);
00153 TAO_FixedArray_Var_T<T,T_slice,TAG> &operator= (
00154 const TAO_FixedArray_Var_T<T,T_slice,TAG> &
00155 );
00156
00157 _out_type out (void);
00158
00159 private:
00160
00161
00162 typedef typename TAO_Array_Var_Base_T<T,T_slice,TAG>::FORANY FORANY;
00163 };
00164
00165
00166
00167
00168
00169
00170
00171
00172 template<typename T, typename T_slice, typename TAG>
00173 class TAO_VarArray_Var_T : public TAO_Array_Var_Base_T<T,T_slice,TAG>
00174 {
00175 public:
00176 typedef T_slice _slice_type;
00177 typedef T_slice *&_out_type;
00178
00179 TAO_VarArray_Var_T (void);
00180 TAO_VarArray_Var_T (_slice_type *);
00181 TAO_VarArray_Var_T (const TAO_VarArray_Var_T<T,T_slice,TAG> &);
00182
00183 TAO_VarArray_Var_T<T,T_slice,TAG> &operator= (_slice_type *);
00184 TAO_VarArray_Var_T<T,T_slice,TAG> &operator= (
00185 const TAO_VarArray_Var_T<T,T_slice,TAG> &
00186 );
00187
00188 _out_type out (void);
00189
00190 operator _slice_type *& ();
00191
00192 private:
00193
00194
00195 typedef typename TAO_Array_Var_Base_T<T,T_slice,TAG>::FORANY FORANY;
00196 };
00197
00198
00199
00200
00201
00202
00203
00204 template<typename T, typename T_var, typename T_slice, typename TAG>
00205 class TAO_Array_Out_T
00206 {
00207 public:
00208 typedef T_slice _slice_type;
00209 typedef T_var _value_type;
00210 typedef T_var _var_type;
00211
00212 TAO_Array_Out_T (_slice_type *&);
00213 TAO_Array_Out_T (_value_type &);
00214 TAO_Array_Out_T (const TAO_Array_Out_T<T,T_var,T_slice,TAG> &);
00215
00216 TAO_Array_Out_T<T,T_var,T_slice,TAG> &operator= (
00217 const TAO_Array_Out_T<T,T_var,T_slice,TAG> &
00218 );
00219 TAO_Array_Out_T<T,T_var,T_slice,TAG> &operator= (_slice_type *);
00220
00221 operator _slice_type *& ();
00222 _slice_type *& ptr (void);
00223
00224 _slice_type & operator[] (CORBA::ULong index);
00225 const _slice_type & operator[] (CORBA::ULong index) const;
00226 private:
00227 typedef TAO_Array_Forany_T<T,T_slice,TAG> FORANY;
00228 typedef TAO_Array_Out_T<T,T_var,T_slice,TAG> THIS_OUT_TYPE;
00229 _slice_type *& ptr_;
00230
00231
00232 void operator= (const _value_type &);
00233 };
00234
00235 TAO_END_VERSIONED_NAMESPACE_DECL
00236
00237 #if defined (__ACE_INLINE__)
00238 #include "tao/Array_VarOut_T.inl"
00239 #endif
00240
00241 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00242 #include "tao/Array_VarOut_T.cpp"
00243 #endif
00244
00245 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00246 #pragma implementation ("Array_VarOut_T.cpp")
00247 #endif
00248
00249 #include "ace/post.h"
00250
00251 #endif