00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Seq_Var_T.h 00006 * 00007 * $Id: Seq_Var_T.h 74014 2006-08-14 13:52:22Z johnnyw $ 00008 * 00009 * @author Jeff Parsons 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_SEQ_VAR_T_H 00014 #define TAO_SEQ_VAR_T_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include /**/ "tao/Versioned_Namespace.h" 00023 00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 /** 00027 * @class TAO_Seq_Var_Base_T 00028 * 00029 * @brief Parametrized implementation of _var base class for sequences 00030 * 00031 */ 00032 template <typename T> 00033 class TAO_Seq_Var_Base_T 00034 { 00035 public: 00036 typedef typename T::subscript_type T_elem; 00037 00038 TAO_Seq_Var_Base_T (void); 00039 TAO_Seq_Var_Base_T (T *); 00040 TAO_Seq_Var_Base_T (const TAO_Seq_Var_Base_T<T> &); 00041 00042 ~TAO_Seq_Var_Base_T (void); 00043 00044 T *operator-> (void); 00045 const T *operator-> (void) const; 00046 00047 operator const T & () const; 00048 operator T & (); 00049 operator T & () const; 00050 00051 typedef const T & _in_type; 00052 typedef T & _inout_type; 00053 typedef T *& _out_type; 00054 typedef T * _retn_type; 00055 00056 // in, inout, out, _retn 00057 _in_type in (void) const; 00058 _inout_type inout (void); 00059 _out_type out (void); 00060 _retn_type _retn (void); 00061 00062 /// TAO extension. 00063 _retn_type ptr (void) const; 00064 protected: 00065 T * ptr_; 00066 }; 00067 00068 /** 00069 * @class TAO_FixedSeq_Var_T 00070 * 00071 * @brief Parametrized implementation of _var class for sequences 00072 * whose element is of fixed size.. 00073 */ 00074 template <typename T> 00075 class TAO_FixedSeq_Var_T : public TAO_Seq_Var_Base_T<T> 00076 { 00077 public: 00078 typedef typename T::subscript_type T_elem; 00079 typedef typename T::const_subscript_type T_const_elem; 00080 00081 TAO_FixedSeq_Var_T (void); 00082 TAO_FixedSeq_Var_T (T *); 00083 TAO_FixedSeq_Var_T (const TAO_FixedSeq_Var_T<T> &); 00084 00085 // Fixed-size base types only. 00086 TAO_FixedSeq_Var_T (const T &); 00087 00088 TAO_FixedSeq_Var_T & operator= (T *); 00089 TAO_FixedSeq_Var_T & operator= (const TAO_FixedSeq_Var_T<T> &); 00090 00091 T_elem operator[] (CORBA::ULong index); 00092 T_const_elem operator[] (CORBA::ULong index) const; 00093 00094 /// Fixed-size base types only. 00095 TAO_FixedSeq_Var_T & operator= (const T &); 00096 }; 00097 00098 /** 00099 * @class TAO_VarSeq_Var_T 00100 * 00101 * @brief Parametrized implementation of _var class for sequences 00102 * whose element is of variable size.. 00103 * 00104 */ 00105 template <typename T> 00106 class TAO_VarSeq_Var_T : public TAO_Seq_Var_Base_T<T> 00107 { 00108 public: 00109 typedef typename T::subscript_type T_elem; 00110 typedef typename T::const_subscript_type T_const_elem; 00111 00112 TAO_VarSeq_Var_T (void); 00113 TAO_VarSeq_Var_T (T *); 00114 TAO_VarSeq_Var_T (const TAO_VarSeq_Var_T<T> &); 00115 00116 TAO_VarSeq_Var_T & operator= (T *); 00117 TAO_VarSeq_Var_T & operator= (const TAO_VarSeq_Var_T<T> &); 00118 00119 T_elem operator[] (CORBA::ULong index); 00120 T_const_elem operator[] (CORBA::ULong index) const; 00121 00122 /// Variable-size base types only. 00123 operator T *& (); 00124 }; 00125 00126 TAO_END_VERSIONED_NAMESPACE_DECL 00127 00128 #if defined (__ACE_INLINE__) 00129 #include "tao/Seq_Var_T.inl" 00130 #endif /* defined INLINE */ 00131 00132 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00133 #include "tao/Seq_Var_T.cpp" 00134 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00135 00136 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00137 #pragma implementation ("Seq_Var_T.cpp") 00138 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00139 00140 #include /**/ "ace/post.h" 00141 00142 #endif /* TAO_SEQ_VAROUT_T_H */