Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Seq_Var_T.h
blob9b51200027a034d8c736f052530c04e4446b86cd
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Seq_Var_T.h
7 * @author Jeff Parsons
8 */
9 //=============================================================================
11 #ifndef TAO_SEQ_VAR_T_H
12 #define TAO_SEQ_VAR_T_H
14 #include /**/ "ace/pre.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include /**/ "tao/Versioned_Namespace.h"
22 #include "tao/Basic_Types.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 /**
27 * @class TAO_Seq_Var_Base_T
29 * @brief Parametrized implementation of _var base class for sequences
31 template <typename T>
32 class TAO_Seq_Var_Base_T
34 public:
35 typedef typename T::subscript_type T_elem;
37 TAO_Seq_Var_Base_T ();
38 TAO_Seq_Var_Base_T (T *);
39 TAO_Seq_Var_Base_T (const TAO_Seq_Var_Base_T<T> &);
41 ~TAO_Seq_Var_Base_T ();
43 T *operator-> ();
44 const T *operator-> () const;
46 operator const T & () const;
47 operator T & ();
48 operator T & () const;
50 typedef const T & _in_type;
51 typedef T & _inout_type;
52 typedef T *& _out_type;
53 typedef T * _retn_type;
55 // in, inout, out, _retn
56 _in_type in () const;
57 _inout_type inout ();
58 _out_type out ();
59 _retn_type _retn ();
61 /// TAO extension.
62 _retn_type ptr () const;
64 protected:
65 T * ptr_;
68 /**
69 * @class TAO_FixedSeq_Var_T
71 * @brief Parametrized implementation of _var class for sequences
72 * whose element is of fixed size..
74 template <typename T>
75 class TAO_FixedSeq_Var_T : public TAO_Seq_Var_Base_T<T>
77 public:
78 typedef typename T::subscript_type T_elem;
79 typedef typename T::const_subscript_type T_const_elem;
81 TAO_FixedSeq_Var_T ();
82 TAO_FixedSeq_Var_T (T *);
83 TAO_FixedSeq_Var_T (const TAO_FixedSeq_Var_T<T> &);
85 // Fixed-size base types only.
86 TAO_FixedSeq_Var_T (const T &);
88 TAO_FixedSeq_Var_T & operator= (T *);
89 TAO_FixedSeq_Var_T & operator= (const TAO_FixedSeq_Var_T<T> &);
91 T_elem operator[] (CORBA::ULong index);
92 T_const_elem operator[] (CORBA::ULong index) const;
94 /// Fixed-size base types only.
95 TAO_FixedSeq_Var_T & operator= (const T &);
98 /**
99 * @class TAO_VarSeq_Var_T
101 * @brief Parametrized implementation of _var class for sequences
102 * whose element is of variable size..
104 template <typename T>
105 class TAO_VarSeq_Var_T : public TAO_Seq_Var_Base_T<T>
107 public:
108 typedef typename T::subscript_type T_elem;
109 typedef typename T::const_subscript_type T_const_elem;
111 TAO_VarSeq_Var_T ();
112 TAO_VarSeq_Var_T (T *);
113 TAO_VarSeq_Var_T (const TAO_VarSeq_Var_T<T> &);
115 TAO_VarSeq_Var_T & operator= (T *);
116 TAO_VarSeq_Var_T & operator= (const TAO_VarSeq_Var_T<T> &);
118 T_elem operator[] (CORBA::ULong index);
119 T_const_elem operator[] (CORBA::ULong index) const;
121 /// Variable-size base types only.
122 operator T *& ();
125 TAO_END_VERSIONED_NAMESPACE_DECL
127 #if defined (__ACE_INLINE__)
128 #include "tao/Seq_Var_T.inl"
129 #endif /* defined INLINE */
131 #include "tao/Seq_Var_T.cpp"
133 #include /**/ "ace/post.h"
135 #endif /* TAO_SEQ_VAROUT_T_H */