Public Types | Public Member Functions

TAO_Fixed_Var_T< T > Class Template Reference

Parametrized implementation of _var class for structs, unions, and exceptions with members of fixed size. More...

#include <VarOut_T.h>

Inheritance diagram for TAO_Fixed_Var_T< T >:
Inheritance graph
[legend]
Collaboration diagram for TAO_Fixed_Var_T< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T & _out_type
typedef T _retn_type

Public Member Functions

 TAO_Fixed_Var_T (void)
 TAO_Fixed_Var_T (T *)
 TAO_Fixed_Var_T (const TAO_Fixed_Var_T< T > &)
 TAO_Fixed_Var_T (const T &)
TAO_Fixed_Var_Toperator= (T *)
TAO_Fixed_Var_Toperator= (const TAO_Fixed_Var_T< T > &)
TAO_Fixed_Var_Toperator= (const T &)
 operator const T & () const
 operator T & ()
 operator T & () const
_out_type out (void)
_retn_type _retn (void)

Detailed Description

template<typename T>
class TAO_Fixed_Var_T< T >

Parametrized implementation of _var class for structs, unions, and exceptions with members of fixed size.

Definition at line 70 of file VarOut_T.h.


Member Typedef Documentation

template<typename T>
typedef T& TAO_Fixed_Var_T< T >::_out_type

Definition at line 90 of file VarOut_T.h.

template<typename T>
typedef T TAO_Fixed_Var_T< T >::_retn_type

Definition at line 91 of file VarOut_T.h.


Constructor & Destructor Documentation

template<typename T >
TAO_Fixed_Var_T< T >::TAO_Fixed_Var_T ( void   ) 

Definition at line 69 of file VarOut_T.inl.

{}

template<typename T >
TAO_Fixed_Var_T< T >::TAO_Fixed_Var_T ( T *  p  ) 

Definition at line 74 of file VarOut_T.inl.

template<typename T >
TAO_Fixed_Var_T< T >::TAO_Fixed_Var_T ( const TAO_Fixed_Var_T< T > &  p  ) 

Definition at line 80 of file VarOut_T.inl.

template<typename T >
TAO_Fixed_Var_T< T >::TAO_Fixed_Var_T ( const T &  p  ) 

Definition at line 87 of file VarOut_T.inl.

{
  ACE_NEW (this->ptr_,
           T (p));
}


Member Function Documentation

template<typename T >
T TAO_Fixed_Var_T< T >::_retn ( void   ) 

Definition at line 148 of file VarOut_T.inl.

{
  return *this->ptr_;
}

template<typename T >
TAO_Fixed_Var_T< T >::operator const T & (  )  const

Definition at line 105 of file VarOut_T.inl.

{
  return *this->ptr_;
}

template<typename T >
TAO_Fixed_Var_T< T >::operator T & (  ) 

Definition at line 112 of file VarOut_T.inl.

{
  // Use plain new, using the ACE_NEW macros will mean we dereference a
  // nil pointer and crash which is more bad then plain new which could
  // lead to a bad_alloc exception
  if (this->ptr_ == 0)
    this->ptr_ = new T;

  return *this->ptr_;
}

template<typename T >
TAO_Fixed_Var_T< T >::operator T & (  )  const

Definition at line 125 of file VarOut_T.inl.

{
  return *this->ptr_;
}

template<typename T >
TAO_Fixed_Var_T< T > & TAO_Fixed_Var_T< T >::operator= ( T *  p  ) 

Definition at line 96 of file VarOut_T.inl.

{
  delete this->ptr_;
  this->ptr_ = p;
  return *this;
}

template<typename T >
TAO_Fixed_Var_T< T > & TAO_Fixed_Var_T< T >::operator= ( const TAO_Fixed_Var_T< T > &  p  ) 

Definition at line 24 of file VarOut_T.cpp.

{
  // Strongly exception safe assignment using copy and non-throwing
  // swap technique.
  TAO_Fixed_Var_T<T> tmp (p);

  T * old_ptr = this->ptr_;
  this->ptr_ = tmp.ptr_;
  tmp.ptr_ = old_ptr;

  return *this;
}

template<typename T >
TAO_Fixed_Var_T< T > & TAO_Fixed_Var_T< T >::operator= ( const T &  p  ) 

Definition at line 40 of file VarOut_T.cpp.

{
  // Strongly exception safe assignment using copy and non-throwing
  // swap technique.
  TAO_Fixed_Var_T<T> tmp (p);

  T * old_ptr = this->ptr_;
  this->ptr_ = tmp.ptr_;
  tmp.ptr_ = old_ptr;

  return *this;
}

template<typename T >
T & TAO_Fixed_Var_T< T >::out ( void   ) 

Definition at line 134 of file VarOut_T.inl.

{
  // Use plain new, using the ACE_NEW macros will mean we dereference a
  // nil pointer and crash which is more bad then plain new which could
  // lead to a bad_alloc exception
  if (this->ptr_ == 0)
    this->ptr_ = new T;

  return *this->ptr_;
}


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines