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

TAO_SeqElem_WString_Manager Class Reference

TAO_SeqElem_WString_Manager. More...

#include <Managed_Types.h>

List of all members.

Public Methods

 TAO_SeqElem_WString_Manager (CORBA::WChar **buffer, CORBA::Boolean release)
 constructor from address of an element. More...

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

 ~TAO_SeqElem_WString_Manager (void)
 destructor. More...

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

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

TAO_SeqElem_WString_Manager & operator= (const CORBA::WChar *)
 assignment from a constant char* will make a copy. More...

TAO_SeqElem_WString_Manager & operator= (CORBA::WChar *)
 assignment from char* will not make a copy. The SeqElem_WString_Manager will now own the string. More...

 operator const CORBA::WChar * () const
 cast (read-only). More...

const CORBA::WCharin (void) const
 for in parameter. More...

CORBA::WChar *& inout (void)
 for inout parameter. More...

CORBA::WChar *& out (void)
 for out parameter. More...

CORBA::WChar_retn (void)
 for string of return type. More...


Private Methods

 TAO_SeqElem_WString_Manager (void)
 default ctor. More...


Private Attributes

CORBA::WChar ** ptr_
 Address of string element from the parent's buffer. More...

CORBA::Boolean release_
 control memory managment semantics. More...


Friends

class TAO_Unbounded_WString_Sequence


Detailed Description

TAO_SeqElem_WString_Manager.

Manager for strings that are the element type of sequences. Similar to the mapping for sequences of objects (and other pseudo objects) the mapping for sequences of strings requires an auxiliar class or <Manager> to handle the allocation and deallocation of the string. The main difference with respect to WString_var classes is that automatic release is not controlled on a per-item basis, but for the sequence as a whole. The difference wrt Object_Manager is that strings are duplicated using CORBA::WString_dup () as opposed to T::_duplicate(), and released using CORBA::WString_free() instead of CORBA::release() This class implements the generic string manager and is used to instantiate the proper sequence types. This class will have the same semantics as the string manager classes defined earlier with respect to the various assignment operators. However, the freeing of old storage will be dependent on the "release" value of the parent sequence class.

Definition at line 259 of file Managed_Types.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_SeqElem_WString_Manager::TAO_SeqElem_WString_Manager CORBA::WChar **    buffer,
CORBA::Boolean    release
 

constructor from address of an element.

Definition at line 295 of file Managed_Types.i.

00297   :  ptr_ (buffer),
00298      release_ (release)
00299 {
00300 }

ACE_INLINE TAO_SeqElem_WString_Manager::TAO_SeqElem_WString_Manager const TAO_SeqElem_WString_Manager &   
 

copy constructor.

Definition at line 287 of file Managed_Types.i.

00288   :  ptr_ (rhs.ptr_),
00289      release_ (rhs.release_)
00290 {
00291 }

ACE_INLINE TAO_SeqElem_WString_Manager::~TAO_SeqElem_WString_Manager void   
 

destructor.

Definition at line 303 of file Managed_Types.i.

00304 {
00305 }

TAO_SeqElem_WString_Manager::TAO_SeqElem_WString_Manager void    [private]
 

default ctor.


Member Function Documentation

ACE_INLINE CORBA::WChar * TAO_SeqElem_WString_Manager::_retn void   
 

for string of return type.

Definition at line 367 of file Managed_Types.i.

References ptr_.

00368 {
00369   CORBA::WChar *temp = *this->ptr_;
00370   *this->ptr_ = 0;
00371   return temp;
00372 }

ACE_INLINE const CORBA::WChar * TAO_SeqElem_WString_Manager::in void    const
 

for in parameter.

Definition at line 347 of file Managed_Types.i.

References ptr_.

00348 {
00349   return *this->ptr_;
00350 }

ACE_INLINE CORBA::WChar *& TAO_SeqElem_WString_Manager::inout void   
 

for inout parameter.

Definition at line 353 of file Managed_Types.i.

References ptr_.

00354 {
00355   return *this->ptr_;
00356 }

ACE_INLINE TAO_SeqElem_WString_Manager::operator const CORBA::WChar *   const
 

cast (read-only).

Definition at line 341 of file Managed_Types.i.

References ptr_.

00342 {
00343   return *this->ptr_;
00344 }

ACE_INLINE TAO_SeqElem_WString_Manager & TAO_SeqElem_WString_Manager::operator= CORBA::WChar  
 

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

Definition at line 332 of file Managed_Types.i.

References ptr_, release_, and CORBA::wstring_free.

00333 {
00334   if (this->release_)
00335     CORBA::wstring_free (*this->ptr_);
00336   *this->ptr_ = p;
00337   return *this;
00338 }

ACE_INLINE TAO_SeqElem_WString_Manager & TAO_SeqElem_WString_Manager::operator= const CORBA::WChar  
 

assignment from a constant char* will make a copy.

Definition at line 322 of file Managed_Types.i.

References ptr_, release_, CORBA::wstring_dup, and CORBA::wstring_free.

00323 {
00324   if (this->release_)
00325     CORBA::wstring_free (*this->ptr_);
00326   *this->ptr_ = CORBA::wstring_dup (p);
00327   return *this;
00328 }

TAO_SeqElem_WString_Manager & TAO_SeqElem_WString_Manager::operator= const CORBA::WString_var  
 

assignment from var type will make a copy.

Definition at line 45 of file Managed_Types.cpp.

References ptr_, release_, CORBA::wstring_dup, and CORBA::wstring_free.

00046 {
00047   if (this->release_)
00048     CORBA::wstring_free (*this->ptr_);
00049   *this->ptr_ = CORBA::wstring_dup (var.in ());
00050   return *this;
00051 }

ACE_INLINE TAO_SeqElem_WString_Manager & TAO_SeqElem_WString_Manager::operator= const TAO_SeqElem_WString_Manager &   
 

assignment from another managed type.

Definition at line 309 of file Managed_Types.i.

References ptr_, release_, CORBA::wstring_dup, and CORBA::wstring_free.

00310 {
00311   if (this == &rhs)
00312     return *this;
00313 
00314   if (this->release_)
00315     CORBA::wstring_free (*this->ptr_);
00316   *this->ptr_ = CORBA::wstring_dup (*rhs.ptr_);
00317   return *this;
00318 }

ACE_INLINE CORBA::WChar *& TAO_SeqElem_WString_Manager::out void   
 

for out parameter.

Definition at line 359 of file Managed_Types.i.

References ptr_, and CORBA::wstring_free.

00360 {
00361   CORBA::wstring_free (*this->ptr_);
00362   *this->ptr_ = 0;
00363   return *this->ptr_;
00364 }


Friends And Related Function Documentation

friend class TAO_Unbounded_WString_Sequence [friend]
 

Definition at line 262 of file Managed_Types.h.


Member Data Documentation

CORBA::WChar** TAO_SeqElem_WString_Manager::ptr_ [private]
 

Address of string element from the parent's buffer.

Definition at line 309 of file Managed_Types.h.

Referenced by _retn, in, inout, operator const CORBA::WChar *, operator=, and out.

CORBA::Boolean TAO_SeqElem_WString_Manager::release_ [private]
 

control memory managment semantics.

Definition at line 312 of file Managed_Types.h.

Referenced by operator=.


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