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 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00025
00026 namespace TAO
00027 {
00028
00029
00030
00031
00032
00033
00034 template<typename T_forany>
00035 struct Array_Traits;
00036 }
00037
00038
00039
00040
00041
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
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
00090
00091
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
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
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
00131
00132
00133
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
00156
00157 typedef typename TAO_Array_Var_Base_T<T,T_slice,TAG>::FORANY FORANY;
00158 };
00159
00160
00161
00162
00163
00164
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
00189
00190 typedef typename TAO_Array_Var_Base_T<T,T_slice,TAG>::FORANY FORANY;
00191 };
00192
00193
00194
00195
00196
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
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
00235
00236 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00237 #include "tao/Array_VarOut_T.cpp"
00238 #endif
00239
00240 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00241 #pragma implementation ("Array_VarOut_T.cpp")
00242 #endif
00243
00244 #include "ace/post.h"
00245
00246 #endif