Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_String_Manager Class Reference

Manager for strings. More...

#include <Managed_Types.h>

List of all members.

Public Methods

 TAO_String_Manager (void)
 default CTOR will initialize the underlying ptr_ to empty string. More...

 TAO_String_Manager (const TAO_String_Manager &)
 copy constructor. More...

 ~TAO_String_Manager (void)
 destructor. More...

TAO_String_Manager & operator= (const TAO_String_Manager &)
 assignment from another managed type. More...

TAO_String_Manager & operator= (const CORBA::String_var &)
 assignment from var type will make a copy. More...

TAO_String_Manager & operator= (const char *)
 assignment from a constant char* will make a copy. More...

TAO_String_Manager & operator= (char *)
 assignment from char* will not make a copy. The String_Manager will now own the string. More...

 operator const char * () const
 cast (read-only). More...

const char * in (void) const
 for in parameter. More...

char *& inout (void)
 for inout parameter. More...

char *& out (void)
 for out parameter. More...

char * _retn (void)
 for string of return type. More...


Private Attributes

char * ptr_
 The underlying string. More...


Detailed Description

Manager for strings.

This class implements the generic string manager and is used in the C++ mapping of "struct" members that are of type "string". The difference between this class and the CORBA::String_var class is that the default conctructor initializes the underlying string to an empty string in this class whereas it is a NUL string for the _var class.

Definition at line 37 of file Managed_Types.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_String_Manager::TAO_String_Manager void   
 

default CTOR will initialize the underlying ptr_ to empty string.

Definition at line 21 of file Managed_Types.i.

References CORBA::string_dup.

00022   :  ptr_ (CORBA::string_dup (""))
00023 {
00024 }

ACE_INLINE TAO_String_Manager::TAO_String_Manager const TAO_String_Manager &   
 

copy constructor.

Definition at line 28 of file Managed_Types.i.

References CORBA::string_dup.

00029   :  ptr_ (CORBA::string_dup (rhs.ptr_))
00030 {
00031 }

ACE_INLINE TAO_String_Manager::~TAO_String_Manager void   
 

destructor.

Definition at line 35 of file Managed_Types.i.

References CORBA::string_free.

00036 {
00037   CORBA::string_free (this->ptr_);
00038 }


Member Function Documentation

ACE_INLINE char * TAO_String_Manager::_retn void   
 

for string of return type.

Definition at line 97 of file Managed_Types.i.

References ptr_.

00098 {
00099   char *temp = this->ptr_;
00100   this->ptr_ = 0;
00101   return temp;
00102 }

ACE_INLINE const char * TAO_String_Manager::in void    const
 

for in parameter.

Definition at line 77 of file Managed_Types.i.

References ptr_.

Referenced by operator<<.

00078 {
00079   return this->ptr_;
00080 }

ACE_INLINE char *& TAO_String_Manager::inout void   
 

for inout parameter.

Definition at line 83 of file Managed_Types.i.

References ptr_.

00084 {
00085   return this->ptr_;
00086 }

ACE_INLINE TAO_String_Manager::operator const char *   const
 

cast (read-only).

Definition at line 71 of file Managed_Types.i.

References ptr_.

00072 {
00073   return this->ptr_;
00074 }

ACE_INLINE TAO_String_Manager & TAO_String_Manager::operator= char *   
 

assignment from char* will not make a copy. The String_Manager will now own the string.

Definition at line 63 of file Managed_Types.i.

References ptr_, and CORBA::string_free.

00064 {
00065   CORBA::string_free (this->ptr_);
00066   this->ptr_ = p;
00067   return *this;
00068 }

ACE_INLINE TAO_String_Manager & TAO_String_Manager::operator= const char *   
 

assignment from a constant char* will make a copy.

Definition at line 54 of file Managed_Types.i.

References ptr_, CORBA::string_dup, and CORBA::string_free.

00055 {
00056   CORBA::string_free (this->ptr_);
00057   this->ptr_ = CORBA::string_dup (p);
00058   return *this;
00059 }

TAO_String_Manager & TAO_String_Manager::operator= const CORBA::String_var  
 

assignment from var type will make a copy.

Definition at line 15 of file Managed_Types.cpp.

References ptr_, CORBA::string_dup, and CORBA::string_free.

00016 {
00017   CORBA::string_free (this->ptr_);
00018   this->ptr_ = CORBA::string_dup (var.in ());
00019   return *this;
00020 }

ACE_INLINE TAO_String_Manager & TAO_String_Manager::operator= const TAO_String_Manager &   
 

assignment from another managed type.

Definition at line 42 of file Managed_Types.i.

References ptr_, CORBA::string_dup, and CORBA::string_free.

00043 {
00044   if (this == &rhs)
00045     return *this;
00046 
00047   CORBA::string_free (this->ptr_);
00048   this->ptr_ = CORBA::string_dup (rhs.ptr_);
00049   return *this;
00050 }

ACE_INLINE char *& TAO_String_Manager::out void   
 

for out parameter.

Definition at line 89 of file Managed_Types.i.

References ptr_, and CORBA::string_free.

Referenced by operator>>.

00090 {
00091   CORBA::string_free (this->ptr_);
00092   this->ptr_ = 0;
00093   return this->ptr_;
00094 }


Member Data Documentation

char* TAO_String_Manager::ptr_ [private]
 

The underlying string.

Definition at line 80 of file Managed_Types.h.

Referenced by _retn, in, inout, operator const char *, operator=, and out.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:39:35 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002