diff options
Diffstat (limited to 'TAO/tao/managed_types.i')
-rw-r--r-- | TAO/tao/managed_types.i | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/TAO/tao/managed_types.i b/TAO/tao/managed_types.i deleted file mode 100644 index 18875ac5558..00000000000 --- a/TAO/tao/managed_types.i +++ /dev/null @@ -1,124 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// managed_types.i -// -// = DESCRIPTION -// C++ mapping of sequences of strings/objrefs or struct/union members with -// strings/objrefs require a special managed type. These types are define -// din this header file. - -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -// ---------------------------------------------------------------------- -// TAO_String_ManagedType type -// ---------------------------------------------------------------------- - -// default constructor -ACE_INLINE -TAO_String_ManagedType::TAO_String_ManagedType (void) - : ptr_ (0), - release_ (1) -{ -} - -// destructor -ACE_INLINE -TAO_String_ManagedType::~TAO_String_ManagedType (void) -{ - if ((this->ptr_ != 0) && this->release_) - CORBA::string_free (this->ptr_); -} - -// construct from char * -ACE_INLINE -TAO_String_ManagedType::TAO_String_ManagedType (char *p, CORBA::Boolean release) - : ptr_ (p), - release_ (release) -{ -} - -// construct from const char*. Will make a copy. So if release is false, memory -// will leak -ACE_INLINE -TAO_String_ManagedType::TAO_String_ManagedType (const char *p, CORBA::Boolean release) - : ptr_ (CORBA::string_dup ((char *) p)), - release_ (release) -{ -} - -// copy constructor -ACE_INLINE -TAO_String_ManagedType::TAO_String_ManagedType (const TAO_String_ManagedType &r, - CORBA::Boolean release) -{ - this->ptr_ = CORBA::string_dup (r.ptr_); - this->release_ = release; -} - -// accesor - read/write -ACE_INLINE CORBA::Char & -TAO_String_ManagedType::operator[] (CORBA::ULong index) -{ - // we need to verify bounds else raise some exception - return this->ptr_[index]; -} - -// read only -ACE_INLINE CORBA::Char -TAO_String_ManagedType::operator[] (CORBA::ULong index) const -{ - // we need to verify bounds else raise some exception - return this->ptr_[index]; -} - -// cast operator (read/write) -ACE_INLINE -TAO_String_ManagedType::operator char *() -{ - return this->ptr_; -} - -// cast operator (read only) -ACE_INLINE -TAO_String_ManagedType::operator const char *() const -{ - return this->ptr_; -} - -// the in, inout, out and _ retn methods for parameter passing - -ACE_INLINE const char * -TAO_String_ManagedType::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE char *& -TAO_String_ManagedType::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE char *& -TAO_String_ManagedType::out (void) -{ - if (this->release_) - CORBA::string_free (this->ptr_); - this->ptr_ = 0; - return this->ptr_; -} - -ACE_INLINE char * -TAO_String_ManagedType::_retn (void) -{ - char *temp = this->ptr_; - this->ptr_ = 0; - return temp; -} |