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

Managed_Types.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Managed_Types.i,v 1.1.1.2 2001/12/04 14:34:46 chad Exp $
00003 
00004 // ============================================================================
00005 //
00006 // = LIBRARY
00007 //    TAO
00008 //
00009 // = FILENAME
00010 //    Managed_Types.i
00011 //
00012 // = AUTHOR
00013 //    Aniruddha Gokhale
00014 //
00015 // ============================================================================
00016 
00017 // ****************************************************************
00018 
00019 // default CTOR initializes to empty string
00020 ACE_INLINE
00021 TAO_String_Manager::TAO_String_Manager (void)
00022   :  ptr_ (CORBA::string_dup (""))
00023 {
00024 }
00025 
00026 // copy ctor copies storage
00027 ACE_INLINE
00028 TAO_String_Manager::TAO_String_Manager (const TAO_String_Manager &rhs)
00029   :  ptr_ (CORBA::string_dup (rhs.ptr_))
00030 {
00031 }
00032 
00033 // destructor
00034 ACE_INLINE
00035 TAO_String_Manager::~TAO_String_Manager (void)
00036 {
00037   CORBA::string_free (this->ptr_);
00038 }
00039 
00040 // assignment
00041 ACE_INLINE TAO_String_Manager&
00042 TAO_String_Manager::operator= (const TAO_String_Manager &rhs)
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 }
00051 
00052 // assignment from const char* makes a copy
00053 ACE_INLINE TAO_String_Manager &
00054 TAO_String_Manager::operator= (const char * p)
00055 {
00056   CORBA::string_free (this->ptr_);
00057   this->ptr_ = CORBA::string_dup (p);
00058   return *this;
00059 }
00060 
00061 // assignment from char* owns the string
00062 ACE_INLINE TAO_String_Manager &
00063 TAO_String_Manager::operator= (char * p)
00064 {
00065   CORBA::string_free (this->ptr_);
00066   this->ptr_ = p;
00067   return *this;
00068 }
00069 
00070 ACE_INLINE
00071 TAO_String_Manager::operator const char* (void) const
00072 {
00073   return this->ptr_;
00074 }
00075 
00076 ACE_INLINE const char *
00077 TAO_String_Manager::in (void) const
00078 {
00079   return this->ptr_;
00080 }
00081 
00082 ACE_INLINE char *&
00083 TAO_String_Manager::inout (void)
00084 {
00085   return this->ptr_;
00086 }
00087 
00088 ACE_INLINE char *&
00089 TAO_String_Manager::out (void)
00090 {
00091   CORBA::string_free (this->ptr_);
00092   this->ptr_ = 0;
00093   return this->ptr_;
00094 }
00095 
00096 ACE_INLINE char *
00097 TAO_String_Manager::_retn (void)
00098 {
00099   char *temp = this->ptr_;
00100   this->ptr_ = 0;
00101   return temp;
00102 }
00103 
00104 // ****************************************************************
00105 
00106 // copy ctor
00107 ACE_INLINE
00108 
00109 TAO_SeqElem_String_Manager::TAO_SeqElem_String_Manager (const TAO_SeqElem_String_Manager &rhs)
00110   :  ptr_ (rhs.ptr_),
00111      release_ (rhs.release_)
00112 {
00113 }
00114 
00115 ACE_INLINE
00116 TAO_SeqElem_String_Manager::TAO_SeqElem_String_Manager (char **buffer,
00117                                                         CORBA::Boolean release)
00118   :  ptr_ (buffer),
00119      release_ (release)
00120 {
00121 }
00122 
00123 ACE_INLINE
00124 TAO_SeqElem_String_Manager::~TAO_SeqElem_String_Manager (void)
00125 {
00126 }
00127 
00128 // assignment
00129 ACE_INLINE TAO_SeqElem_String_Manager&
00130 TAO_SeqElem_String_Manager::operator= (const TAO_SeqElem_String_Manager &rhs)
00131 {
00132   if (this == &rhs)
00133     return *this;
00134 
00135   if (this->release_)
00136     CORBA::string_free (*this->ptr_);
00137   *this->ptr_ = CORBA::string_dup (*rhs.ptr_);
00138   return *this;
00139 }
00140 
00141 // assignment from const char* will make copy
00142 ACE_INLINE TAO_SeqElem_String_Manager &
00143 TAO_SeqElem_String_Manager::operator= (const char *p)
00144 {
00145   if (this->release_)
00146     CORBA::string_free (*this->ptr_);
00147   *this->ptr_ = CORBA::string_dup (p);
00148   return *this;
00149 }
00150 
00151 // assignment from char* will own it
00152 ACE_INLINE TAO_SeqElem_String_Manager &
00153 TAO_SeqElem_String_Manager::operator= (char *p)
00154 {
00155   if (this->release_)
00156     CORBA::string_free (*this->ptr_);
00157   *this->ptr_ = p;
00158   return *this;
00159 }
00160 
00161 ACE_INLINE
00162 TAO_SeqElem_String_Manager::operator const char* (void) const
00163 {
00164   return *this->ptr_;
00165 }
00166 
00167 ACE_INLINE const char *
00168 TAO_SeqElem_String_Manager::in (void) const
00169 {
00170   return *this->ptr_;
00171 }
00172 
00173 ACE_INLINE char *&
00174 TAO_SeqElem_String_Manager::inout (void)
00175 {
00176   return *this->ptr_;
00177 }
00178 
00179 ACE_INLINE char *&
00180 TAO_SeqElem_String_Manager::out (void)
00181 {
00182   CORBA::string_free (*this->ptr_);
00183   *this->ptr_ = 0;
00184   return *this->ptr_;
00185 }
00186 
00187 ACE_INLINE char *
00188 TAO_SeqElem_String_Manager::_retn (void)
00189 {
00190   char *temp = *this->ptr_;
00191   *this->ptr_ = 0;
00192   return temp;
00193 }
00194 
00195 // ****************************************************************
00196 
00197 // default CTOR initializes to empty string
00198 ACE_INLINE
00199 TAO_WString_Manager::TAO_WString_Manager (void)
00200   :  ptr_ (0) // @@ CORBA::wstring_dup (""))
00201 {
00202 }
00203 
00204 // copy ctor copies storage
00205 ACE_INLINE
00206 TAO_WString_Manager::TAO_WString_Manager (const TAO_WString_Manager &rhs)
00207   :  ptr_ (CORBA::wstring_dup (rhs.ptr_))
00208 {
00209 }
00210 
00211 // destructor
00212 ACE_INLINE
00213 TAO_WString_Manager::~TAO_WString_Manager (void)
00214 {
00215   CORBA::wstring_free (this->ptr_);
00216 }
00217 
00218 // assignment
00219 ACE_INLINE TAO_WString_Manager&
00220 TAO_WString_Manager::operator= (const TAO_WString_Manager &rhs)
00221 {
00222   if (this == &rhs)
00223     return *this;
00224 
00225   CORBA::wstring_free (this->ptr_);
00226   this->ptr_ = CORBA::wstring_dup (rhs.ptr_);
00227   return *this;
00228 }
00229 
00230 // assignment from const CORBA::WChar* makes a copy
00231 ACE_INLINE TAO_WString_Manager &
00232 TAO_WString_Manager::operator= (const CORBA::WChar * p)
00233 {
00234   CORBA::wstring_free (this->ptr_);
00235   this->ptr_ = CORBA::wstring_dup (p);
00236   return *this;
00237 }
00238 
00239 // assignment from CORBA::WChar* owns the string
00240 ACE_INLINE TAO_WString_Manager &
00241 TAO_WString_Manager::operator= (CORBA::WChar * p)
00242 {
00243   CORBA::wstring_free (this->ptr_);
00244   this->ptr_ = p;
00245   return *this;
00246 }
00247 
00248 ACE_INLINE
00249 TAO_WString_Manager::operator const CORBA::WChar* (void) const
00250 {
00251   return this->ptr_;
00252 }
00253 
00254 ACE_INLINE const CORBA::WChar *
00255 TAO_WString_Manager::in (void) const
00256 {
00257   return this->ptr_;
00258 }
00259 
00260 ACE_INLINE CORBA::WChar *&
00261 TAO_WString_Manager::inout (void)
00262 {
00263   return this->ptr_;
00264 }
00265 
00266 ACE_INLINE CORBA::WChar *&
00267 TAO_WString_Manager::out (void)
00268 {
00269   CORBA::wstring_free (this->ptr_);
00270   this->ptr_ = 0;
00271   return this->ptr_;
00272 }
00273 
00274 ACE_INLINE CORBA::WChar *
00275 TAO_WString_Manager::_retn (void)
00276 {
00277   CORBA::WChar *temp = this->ptr_;
00278   this->ptr_ = 0;
00279   return temp;
00280 }
00281 
00282 // ****************************************************************
00283 
00284 // copy ctor
00285 ACE_INLINE
00286 
00287 TAO_SeqElem_WString_Manager::TAO_SeqElem_WString_Manager (const TAO_SeqElem_WString_Manager &rhs)
00288   :  ptr_ (rhs.ptr_),
00289      release_ (rhs.release_)
00290 {
00291 }
00292 
00293 ACE_INLINE
00294 
00295 TAO_SeqElem_WString_Manager::    TAO_SeqElem_WString_Manager (CORBA::WChar **buffer,
00296                                  CORBA::Boolean release)
00297   :  ptr_ (buffer),
00298      release_ (release)
00299 {
00300 }
00301 
00302 ACE_INLINE
00303 TAO_SeqElem_WString_Manager::~TAO_SeqElem_WString_Manager (void)
00304 {
00305 }
00306 
00307 // assignment
00308 ACE_INLINE TAO_SeqElem_WString_Manager&
00309 TAO_SeqElem_WString_Manager::operator= (const TAO_SeqElem_WString_Manager &rhs)
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 }
00319 
00320 // assignment from const CORBA::WChar* will make copy
00321 ACE_INLINE TAO_SeqElem_WString_Manager &
00322 TAO_SeqElem_WString_Manager::operator= (const CORBA::WChar *p)
00323 {
00324   if (this->release_)
00325     CORBA::wstring_free (*this->ptr_);
00326   *this->ptr_ = CORBA::wstring_dup (p);
00327   return *this;
00328 }
00329 
00330 // assignment from CORBA::WChar* will own it
00331 ACE_INLINE TAO_SeqElem_WString_Manager &
00332 TAO_SeqElem_WString_Manager::operator= (CORBA::WChar *p)
00333 {
00334   if (this->release_)
00335     CORBA::wstring_free (*this->ptr_);
00336   *this->ptr_ = p;
00337   return *this;
00338 }
00339 
00340 ACE_INLINE
00341 TAO_SeqElem_WString_Manager::operator const CORBA::WChar* (void) const
00342 {
00343   return *this->ptr_;
00344 }
00345 
00346 ACE_INLINE const CORBA::WChar *
00347 TAO_SeqElem_WString_Manager::in (void) const
00348 {
00349   return *this->ptr_;
00350 }
00351 
00352 ACE_INLINE CORBA::WChar *&
00353 TAO_SeqElem_WString_Manager::inout (void)
00354 {
00355   return *this->ptr_;
00356 }
00357 
00358 ACE_INLINE CORBA::WChar *&
00359 TAO_SeqElem_WString_Manager::out (void)
00360 {
00361   CORBA::wstring_free (*this->ptr_);
00362   *this->ptr_ = 0;
00363   return *this->ptr_;
00364 }
00365 
00366 ACE_INLINE CORBA::WChar *
00367 TAO_SeqElem_WString_Manager::_retn (void)
00368 {
00369   CORBA::WChar *temp = *this->ptr_;
00370   *this->ptr_ = 0;
00371   return temp;
00372 }

Generated on Mon Jun 16 13:48:54 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002