Public Types | Public Member Functions | Private Attributes

TAO::String_Manager_T< charT > Class Template Reference

#include <String_Manager_T.h>

List of all members.

Public Types

typedef charT character_type
typedef
TAO::details::string_traits_base
< charT > 
s_traits

Public Member Functions

 String_Manager_T (void)
 Default CTOR will initialize the underlying ptr_ to empty string.
 String_Manager_T (const String_Manager_T< charT > &rhs)
 Copy constructor.
 String_Manager_T (const character_type *s)
 Constructor from const char* makes a copy.
 ~String_Manager_T (void)
 Destructor.
String_Manager_Toperator= (const String_Manager_T< charT > &rhs)
 Assignment from another managed type.
String_Manager_Toperator= (const typename s_traits::string_var &value)
 Assignment from var type will make a copy.
String_Manager_Toperator= (const character_type *p)
 Assignment from a constant * will make a copy.
String_Manager_Toperator= (character_type *p)
 operator const character_type * () const
 Cast (read-only).
const character_type * in (void) const
 For in parameter.
character_type *& inout (void)
 For inout parameter.
character_type *& out (void)
 for out parameter.
character_type * _retn (void)
 For string of return type.

Private Attributes

character_type * ptr_
 The underlying string.

Detailed Description

template<typename charT>
class TAO::String_Manager_T< charT >

Definition at line 37 of file String_Manager_T.h.


Member Typedef Documentation

template<typename charT>
typedef charT TAO::String_Manager_T< charT >::character_type

Definition at line 40 of file String_Manager_T.h.

template<typename charT>
typedef TAO::details::string_traits_base<charT> TAO::String_Manager_T< charT >::s_traits

Definition at line 41 of file String_Manager_T.h.


Constructor & Destructor Documentation

template<typename charT>
TAO::String_Manager_T< charT >::String_Manager_T ( void   )  [inline]

Default CTOR will initialize the underlying ptr_ to empty string.

Definition at line 44 of file String_Manager_T.h.

                                 : ptr_ (s_traits::default_initializer())
  {
  }

template<typename charT>
TAO::String_Manager_T< charT >::String_Manager_T ( const String_Manager_T< charT > &  rhs  )  [inline]

Copy constructor.

Definition at line 49 of file String_Manager_T.h.

                                                               :
    ptr_ (s_traits::duplicate (rhs.ptr_))
  {
  }

template<typename charT>
TAO::String_Manager_T< charT >::String_Manager_T ( const character_type *  s  )  [inline]

Constructor from const char* makes a copy.

Definition at line 55 of file String_Manager_T.h.

                                                    :
    ptr_ (s_traits::duplicate (s))
  {
  }

template<typename charT>
TAO::String_Manager_T< charT >::~String_Manager_T ( void   )  [inline]

Destructor.

Definition at line 61 of file String_Manager_T.h.

                                  {
    s_traits::release (this->ptr_);
  }


Member Function Documentation

template<typename charT>
character_type* TAO::String_Manager_T< charT >::_retn ( void   )  [inline]

For string of return type.

Definition at line 123 of file String_Manager_T.h.

                                      {
    character_type *temp = this->ptr_;
    this->ptr_ = 0;
    return temp;
  }

template<typename charT>
const character_type* TAO::String_Manager_T< charT >::in ( void   )  const [inline]

For in parameter.

Definition at line 106 of file String_Manager_T.h.

                                               {
    return this->ptr_;
  }

template<typename charT>
character_type*& TAO::String_Manager_T< charT >::inout ( void   )  [inline]

For inout parameter.

Definition at line 111 of file String_Manager_T.h.

                                       {
    return this->ptr_;
  }

template<typename charT>
TAO::String_Manager_T< charT >::operator const character_type * (  )  const [inline]

Cast (read-only).

Definition at line 101 of file String_Manager_T.h.

                                                {
    return this->ptr_;
  }

template<typename charT>
String_Manager_T& TAO::String_Manager_T< charT >::operator= ( character_type *  p  )  [inline]

Assignment from char* will not make a copy. The String_Manager_T will now own the string.

Definition at line 94 of file String_Manager_T.h.

                                                         {
    s_traits::release (this->ptr_);
    this->ptr_ = p;
    return *this;
  }

template<typename charT>
String_Manager_T& TAO::String_Manager_T< charT >::operator= ( const typename s_traits::string_var &  value  )  [inline]

Assignment from var type will make a copy.

Definition at line 75 of file String_Manager_T.h.

                                                                                {
    // Strongly exception safe by means of copy and non-throwing swap
    // technique.
    String_Manager_T <character_type> tmp (value.in ());
    std::swap (this->ptr_, tmp.ptr_);
    return *this;
  }

template<typename charT>
String_Manager_T& TAO::String_Manager_T< charT >::operator= ( const String_Manager_T< charT > &  rhs  )  [inline]

Assignment from another managed type.

Definition at line 66 of file String_Manager_T.h.

                                                                          {
    // Strongly exception safe by means of copy and non-throwing swap
    // technique.
    String_Manager_T <character_type> tmp (rhs);
    std::swap (this->ptr_, tmp.ptr_);
    return *this;
  }

template<typename charT>
String_Manager_T& TAO::String_Manager_T< charT >::operator= ( const character_type *  p  )  [inline]

Assignment from a constant * will make a copy.

Definition at line 84 of file String_Manager_T.h.

                                                               {
    // Strongly exception safe by means of copy and non-throwing swap
    // technique.
    String_Manager_T <character_type> tmp (p);
    std::swap (this->ptr_, tmp.ptr_);
    return *this;
  }

template<typename charT>
character_type*& TAO::String_Manager_T< charT >::out ( void   )  [inline]

for out parameter.

Definition at line 116 of file String_Manager_T.h.

                                     {
    s_traits::release (this->ptr_);
    this->ptr_ = 0;
    return this->ptr_;
  }


Member Data Documentation

template<typename charT>
character_type* TAO::String_Manager_T< charT >::ptr_ [private]

The underlying string.

Definition at line 131 of file String_Manager_T.h.


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