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

CORBA_String_var Class Reference

CORBA_String var class. Provides automatic deallocation of storage for the string once it goes out of scope. More...

#include <CORBA_String.h>

List of all members.

Public Methods

 CORBA_String_var (void)
 default constructor. More...

 CORBA_String_var (char *p)
 constructor, owns p. More...

 CORBA_String_var (const char *p)
 constructor. Makes a copy of p. More...

 CORBA_String_var (const CORBA_String_var &s)
 copy constructor. More...

 ~CORBA_String_var (void)
 destructor. More...

CORBA_String_var & operator= (char *p)
 assignment operator. More...

CORBA_String_var & operator= (const char *p)
 assignment to a const char*. Makes a copy. More...

CORBA_String_var & operator= (const CORBA_String_var &s)
 assignment operator. More...

 operator char *& ()
 Read/write version. More...

 operator const char * () const
 Only read privileges. More...

char & operator[] (CORBA::ULong slot)
 allows access and modification using an slot. More...

char operator[] (CORBA::ULong slot) const
 allows only accessing thru an slot. 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_
 instance. More...


Detailed Description

CORBA_String var class. Provides automatic deallocation of storage for the string once it goes out of scope.

Definition at line 42 of file CORBA_String.h.


Constructor & Destructor Documentation

ACE_INLINE CORBA_String_var::CORBA_String_var void   
 

default constructor.

Definition at line 10 of file CORBA_String.inl.

00011   : ptr_ (0)
00012 {
00013 }

CORBA_String_var::CORBA_String_var char *    p
 

constructor, owns p.

Definition at line 17 of file CORBA_String.cpp.

00018   : ptr_ (p)
00019 {
00020   // NOTE: According to the CORBA spec this string must *not* be
00021   // copied, but it is non-compliant to use it/release it in the
00022   // calling code.  argument is consumed. p should never be NULL
00023 }

ACE_INLINE CORBA_String_var::CORBA_String_var const char *    p
 

constructor. Makes a copy of p.

Definition at line 16 of file CORBA_String.inl.

References CORBA::string_dup.

00017   : ptr_ (CORBA::string_dup (p))
00018 {
00019 }

CORBA_String_var::CORBA_String_var const CORBA_String_var &    s
 

copy constructor.

Definition at line 25 of file CORBA_String.cpp.

References ptr_, and CORBA::string_dup.

00026 {
00027   this->ptr_ = CORBA::string_dup (r.ptr_);
00028 }

CORBA_String_var::~CORBA_String_var void   
 

destructor.

Definition at line 30 of file CORBA_String.cpp.

References ptr_, and CORBA::string_free.

00031 {
00032   CORBA::string_free (this->ptr_);
00033   this->ptr_ = 0;
00034 }


Member Function Documentation

ACE_INLINE char * CORBA_String_var::_retn void   
 

for string of return type.

Definition at line 68 of file CORBA_String.inl.

References ptr_.

00069 {
00070   char *temp = this->ptr_;
00071   this->ptr_ = 0;
00072   return temp;
00073 }

ACE_INLINE const char * CORBA_String_var::in void    const
 

for in parameter.

Definition at line 48 of file CORBA_String.inl.

References ptr_.

00049 {
00050   return this->ptr_;
00051 }

ACE_INLINE char *& CORBA_String_var::inout void   
 

for inout parameter.

Definition at line 54 of file CORBA_String.inl.

References ptr_.

00055 {
00056   return this->ptr_;
00057 }

ACE_INLINE CORBA_String_var::operator char *&  
 

Read/write version.

Definition at line 36 of file CORBA_String.inl.

References ptr_.

00037 {
00038   return this->ptr_;
00039 }

ACE_INLINE CORBA_String_var::operator const char *   const
 

Only read privileges.

Definition at line 42 of file CORBA_String.inl.

References ptr_.

00043 {
00044   return this->ptr_;
00045 }

CORBA_String_var & CORBA_String_var::operator= const CORBA_String_var &    s
 

assignment operator.

Definition at line 57 of file CORBA_String.cpp.

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

00058 {
00059   if (this != &r)
00060     {
00061       CORBA::string_free (this->ptr_);
00062       this->ptr_ = CORBA::string_dup (r.ptr_);
00063     }
00064   return *this;
00065 }

CORBA_String_var & CORBA_String_var::operator= const char *    p
 

assignment to a const char*. Makes a copy.

Definition at line 48 of file CORBA_String.cpp.

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

00049 {
00050   CORBA::string_free (this->ptr_);
00051 
00052   this->ptr_ = CORBA::string_dup (p);
00053   return *this;
00054 }

CORBA_String_var & CORBA_String_var::operator= char *    p
 

assignment operator.

Definition at line 37 of file CORBA_String.cpp.

References ptr_, and CORBA::string_free.

00038 {
00039   if (this->ptr_ != p)
00040     {
00041       CORBA::string_free (this->ptr_);
00042       this->ptr_ = p;
00043     }
00044   return *this;
00045 }

ACE_INLINE CORBA::Char CORBA_String_var::operator[] CORBA::ULong    slot const
 

allows only accessing thru an slot.

Definition at line 29 of file CORBA_String.inl.

References ptr_.

00030 {
00031   // We need to verify bounds else raise some exception.
00032   return this->ptr_[slot];
00033 }

ACE_INLINE CORBA::Char & CORBA_String_var::operator[] CORBA::ULong    slot
 

allows access and modification using an slot.

Definition at line 22 of file CORBA_String.inl.

References ptr_.

00023 {
00024   // We need to verify bounds else raise some exception.
00025   return this->ptr_[slot];
00026 }

ACE_INLINE char *& CORBA_String_var::out void   
 

for out parameter.

Definition at line 60 of file CORBA_String.inl.

References ptr_, and CORBA::string_free.

00061 {
00062   CORBA::string_free (this->ptr_);
00063   this->ptr_ = 0;
00064   return this->ptr_;
00065 }


Member Data Documentation

char* CORBA_String_var::ptr_ [private]
 

instance.

Definition at line 98 of file CORBA_String.h.

Referenced by _retn, CORBA_String_var, in, inout, operator char *&, operator const char *, operator=, operator[], out, and ~CORBA_String_var.


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