diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-04-22 20:53:09 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-04-22 20:53:09 +0000 |
commit | d254156433bdb336317aa6ba9750e16cfe4c9db1 (patch) | |
tree | b325bb726be5c711dfe09e642820f85ea7c01e02 /TAO/tao/Seq_Var_T.h | |
parent | 5dbda4cbe83f7f0b1be421f1efe864c0ea109283 (diff) | |
download | ATCD-d254156433bdb336317aa6ba9750e16cfe4c9db1.tar.gz |
ChangeLogTag:Tue Apr 22 14:58:33 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Seq_Var_T.h')
-rw-r--r-- | TAO/tao/Seq_Var_T.h | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/TAO/tao/Seq_Var_T.h b/TAO/tao/Seq_Var_T.h new file mode 100644 index 00000000000..bef3486c7ec --- /dev/null +++ b/TAO/tao/Seq_Var_T.h @@ -0,0 +1,152 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Seq_Var_T.h + * + * $Id$ + * + * @author Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_SEQ_VAR_T_H +#define TAO_SEQ_VAR_T_H + +#include "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @class TAO_Seq_Var_Base_T + * + * @brief Parametrized implementation of _var base class for sequences + * + */ +template <typename T, typename T_elem> +class TAO_Seq_Var_Base_T +{ +public: + TAO_Seq_Var_Base_T (void); + TAO_Seq_Var_Base_T (T *); + TAO_Seq_Var_Base_T (const TAO_Seq_Var_Base_T<T,T_elem> &); + + ~TAO_Seq_Var_Base_T (void); + + T *operator-> (void); + const T *operator-> (void) const; + + operator const T &() const; + operator T &(); + operator T &() const; + + // in, inout, out, _retn + const T & in (void) const; + T & inout (void); + T *& out (void); + T * _retn (void); + + // TAO extension. + T * ptr (void) const; + +protected: + T * ptr_; +}; + +/** + * @class TAO_FixedSeq_Var_T + * + * @brief Parametrized implementation of _var class for sequences + * whose element is of fixed size.. + * + */ +template <typename T, typename T_elem> +class TAO_FixedSeq_Var_T : public TAO_Seq_Var_Base_T<T,T_elem> +{ +public: + TAO_FixedSeq_Var_T (void); + TAO_FixedSeq_Var_T (T *); + TAO_FixedSeq_Var_T (const TAO_FixedSeq_Var_T<T,T_elem> &); + + // Fixed-size base types only. + TAO_FixedSeq_Var_T (const T &); + + TAO_FixedSeq_Var_T & operator= (T *); + TAO_FixedSeq_Var_T & operator= (const TAO_FixedSeq_Var_T<T,T_elem> &); + + T_elem & operator[] (CORBA::ULong index); + + // Fixed-size base types only. + TAO_FixedSeq_Var_T & operator= (const T &); +}; + +/** + * @class TAO_VarSeq_Var_T + * + * @brief Parametrized implementation of _var class for sequences + * whose element is of variable size.. + * + */ +template <typename T, typename T_elem> +class TAO_VarSeq_Var_T : public TAO_Seq_Var_Base_T<T,T_elem> +{ +public: + TAO_VarSeq_Var_T (void); + TAO_VarSeq_Var_T (T *); + TAO_VarSeq_Var_T (const TAO_VarSeq_Var_T<T,T_elem> &); + + TAO_VarSeq_Var_T & operator= (T *); + TAO_VarSeq_Var_T & operator= (const TAO_VarSeq_Var_T<T,T_elem> &); + + T_elem & operator[] (CORBA::ULong index); + + // Variable-size base types only. + operator T *& (); +}; + +/** + * @class TAO_MngSeq_Var_T + * + * @brief Parametrized implementation of _var class for sequences + * whose element is of a managed type - string, wstring, valuetype, + * interface, abstract interface and pseudo object. + * + */ +template <typename T, typename T_elem> +class TAO_MngSeq_Var_T : public TAO_Seq_Var_Base_T<T,T_elem> +{ +public: + TAO_MngSeq_Var_T (void); + TAO_MngSeq_Var_T (T *); + TAO_MngSeq_Var_T (const TAO_MngSeq_Var_T<T,T_elem> &); + + TAO_MngSeq_Var_T & operator= (T *); + TAO_MngSeq_Var_T & operator= (const TAO_MngSeq_Var_T<T,T_elem> &); + + // Variable-size base types only. + operator T *& (); + + // Managed base types only. + T_elem operator[] (CORBA::ULong index); +}; + + + +#if defined (__ACE_INLINE__) +#include "Seq_Var_T.inl" +#endif /* defined INLINE */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/Seq_Var_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Seq_Var_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" + +#endif /* TAO_SEQ_VAROUT_T_H */ |