diff options
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/CDR_Interpreter.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/Managed_Types.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/Managed_Types.h | 55 | ||||
-rw-r--r-- | TAO/tao/Managed_Types.i | 31 | ||||
-rw-r--r-- | TAO/tao/Marshal.i | 8 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 118 | ||||
-rw-r--r-- | TAO/tao/ORB.h | 109 | ||||
-rw-r--r-- | TAO/tao/ORB.i | 128 | ||||
-rw-r--r-- | TAO/tao/POA.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/POA.h | 4 | ||||
-rw-r--r-- | TAO/tao/Request.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/Typecode_Constants.cpp | 398 | ||||
-rw-r--r-- | TAO/tao/corbafwd.h | 31 | ||||
-rw-r--r-- | TAO/tao/corbafwd.i | 31 |
14 files changed, 620 insertions, 338 deletions
diff --git a/TAO/tao/CDR_Interpreter.cpp b/TAO/tao/CDR_Interpreter.cpp index 4fee1c6fde2..d484286be3e 100644 --- a/TAO/tao/CDR_Interpreter.cpp +++ b/TAO/tao/CDR_Interpreter.cpp @@ -190,7 +190,7 @@ declare_entry (CORBA::LongLong, tk_longlong); declare_entry (CORBA::ULongLong, tk_ulonglong); declare_entry (CORBA::LongDouble, tk_longdouble); declare_entry (CORBA::WChar, tk_wchar); -declare_entry (CORBA::WString, tk_wstring); +declare_entry (CORBA::WChar*, tk_wstring); void TAO_CDR_Interpreter::init (void) @@ -231,7 +231,7 @@ TAO_CDR_Interpreter::init (void) setup_entry (CORBA::ULongLong, tk_ulonglong); setup_entry (CORBA::LongDouble, tk_longdouble); setup_entry (CORBA::WChar, tk_wchar); - setup_entry (CORBA::WString, tk_wstring); + setup_entry (CORBA::WChar*, tk_wstring); } #undef setup @@ -461,7 +461,7 @@ TAO_CDR_Interpreter::calc_nested_size_and_alignment (CORBA::TypeCode_ptr tc, } // Notice how we change the sign of the offset to estimate the - // maximum size. + // maximum size. // Also note that the offset is computed starting from the offset // field. However, by this time, we have already read the offset field i.e., // we have already moved ahead by 4 bytes (size of CORBA::Long). So we should @@ -638,7 +638,7 @@ TAO_CDR_Interpreter::calc_key_union_attributes (TAO_InputCDR *stream, void *two; }; align_ptr ap; - + // the first member of the union internal representation is the VPTR // since every union inherits from TAO_Base_Union overall_alignment = (char *) &ap.two - (char *) &ap.one @@ -663,7 +663,7 @@ TAO_CDR_Interpreter::calc_key_union_attributes (TAO_InputCDR *stream, CORBA::TypeCode discrim_tc (CORBA::tk_void); discrim_and_base_size = sizeof (TAO_Base_Union) + - calc_nested_size_and_alignment (&discrim_tc, + calc_nested_size_and_alignment (&discrim_tc, stream, value_alignment, env); @@ -673,7 +673,7 @@ TAO_CDR_Interpreter::calc_key_union_attributes (TAO_InputCDR *stream, if (value_alignment > overall_alignment) overall_alignment = value_alignment; - + // skip "default used" indicator, and save "member count" if (!stream->read_ulong (temp) // default used @@ -797,9 +797,9 @@ TAO_CDR_Interpreter::calc_key_union_attributes (TAO_InputCDR *stream, // Round up the discriminator's size to include padding it needs in // order to be followed by the value. - discrim_and_base_size_with_pad = + discrim_and_base_size_with_pad = (size_t) align_binary (discrim_and_base_size, value_alignment); - discrim_size_with_pad = discrim_and_base_size_with_pad - + discrim_size_with_pad = discrim_and_base_size_with_pad - sizeof (TAO_Base_Union); // Now calculate the overall size of the structure, which is the // discriminator, inter-element padding, value, and tail padding. diff --git a/TAO/tao/Managed_Types.cpp b/TAO/tao/Managed_Types.cpp index 8f1d3f92aa7..1510168df07 100644 --- a/TAO/tao/Managed_Types.cpp +++ b/TAO/tao/Managed_Types.cpp @@ -28,3 +28,22 @@ TAO_SeqElem_String_Manager::operator= (const CORBA::String_var &var) return *this; } +// **************************************************************** + +TAO_WString_Manager& +TAO_WString_Manager::operator= (const CORBA::WString_var &var) +{ + CORBA::wstring_free (this->ptr_); + this->ptr_ = CORBA::wstring_dup (var.in ()); + return *this; +} + +TAO_SeqElem_WString_Manager& +TAO_SeqElem_WString_Manager::operator= (const CORBA::WString_var &var) +{ + if (this->release_) + CORBA::wstring_free (*this->ptr_); + *this->ptr_ = CORBA::wstring_dup (var.in ()); + return *this; +} + diff --git a/TAO/tao/Managed_Types.h b/TAO/tao/Managed_Types.h index 81b11412f62..72fd617f6c5 100644 --- a/TAO/tao/Managed_Types.h +++ b/TAO/tao/Managed_Types.h @@ -38,7 +38,7 @@ class TAO_Export TAO_String_Manager public: TAO_String_Manager (void); - // default CTOR will initialize the underlying ptr_ to empty string. + // default CTOR will initialize the underlying ptr_ to empty string. TAO_String_Manager (const TAO_String_Manager &); // copy constructor @@ -170,8 +170,7 @@ private: }; -#if 0 /* WString_var not implemented in TAO yet - 01/03/1999 */ -/****************************************************************/ +// **************************************************************** class TAO_Export TAO_WString_Manager { @@ -180,16 +179,18 @@ class TAO_Export TAO_WString_Manager // // = DESCRIPTION // - // This class implements the generic wstring manager and is used in the C++ - // mapping of "struct" members that are of type "wstring". The difference - // between this class and the CORBA::WString_var class is that the default - // conctructor initializes the underlying wstring to an empty string in this - // class whereas it is a NUL wstring for the _var class. + // This class implements the generic wstring manager and is used + // in the C++ mapping of "struct" members that are of type + // "wstring". + // The difference between this class and the CORBA::WString_var + // class is that the default constructor initializes the + // underlying wstring to an empty string in this class whereas it + // is a NUL wstring for the _var class. // public: TAO_WString_Manager (void); - // default CTOR will initialize the underlying ptr_ to empty string. + // default CTOR will initialize the underlying ptr_ to empty string. TAO_WString_Manager (const TAO_WString_Manager &); // copy constructor @@ -207,8 +208,8 @@ public: // assignment from a constant wchar* will make a copy TAO_WString_Manager &operator= (CORBA::WChar *); - // assignment from wchar* will not make a copy. The WString_Manager will now - // own the string. + // assignment from wchar* will not make a copy. The WString_Manager + // will now own the string. operator const CORBA::WChar*() const; // cast (read-only) @@ -255,10 +256,10 @@ class TAO_Export TAO_SeqElem_WString_Manager // 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. + // 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. // public: friend class TAO_Unbounded_WString_Sequence; @@ -268,7 +269,8 @@ public: // friend template<CORBA::ULong MAX> // class TAO_Bounded_WString_Sequence<TAO_SeqElem_WString_Manager,MAX>; - TAO_SeqElem_WString_Manager (char **buffer, CORBA::Boolean release); + TAO_SeqElem_WString_Manager (CORBA::WChar **buffer, + CORBA::Boolean release); // constructor from address of an element ~TAO_SeqElem_WString_Manager (void); @@ -280,30 +282,30 @@ public: TAO_SeqElem_WString_Manager &operator= (const CORBA::WString_var&); // assignment from var type will make a copy - TAO_SeqElem_WString_Manager &operator= (const char *); + TAO_SeqElem_WString_Manager &operator= (const CORBA::WChar *); // assignment from a constant char* will make a copy - TAO_SeqElem_WString_Manager &operator= (char *); - // assignment from char* will not make a copy. The SeqElem_WString_Manager will now - // own the string. + TAO_SeqElem_WString_Manager &operator= (CORBA::WChar *); + // assignment from char* will not make a copy. The + // SeqElem_WString_Manager will now own the string. - operator const char*() const; + operator const CORBA::WChar*() const; // cast (read-only) - const char *in (void) const; + const CORBA::WChar *in (void) const; // for in parameter. - char *&inout (void); + CORBA::WChar *&inout (void); // for inout parameter. - char *&out (void); + CORBA::WChar *&out (void); // for out parameter. - char *_retn (void); + CORBA::WChar *_retn (void); // for string of return type. private: - char **ptr_; + CORBA::WChar **ptr_; // Address of string element from the parent's buffer. CORBA::Boolean release_; @@ -320,7 +322,6 @@ private: // copy constructor }; -#endif /* 0 */ #if defined (__ACE_INLINE__) #include "tao/Managed_Types.i" diff --git a/TAO/tao/Managed_Types.i b/TAO/tao/Managed_Types.i index 88aac12835e..dc5eda08f2e 100644 --- a/TAO/tao/Managed_Types.i +++ b/TAO/tao/Managed_Types.i @@ -19,7 +19,7 @@ // default CTOR initializes to empty string ACE_INLINE TAO_String_Manager::TAO_String_Manager (void) - : ptr_ (CORBA::string_dup ("")) + : ptr_ (0) // @@ CORBA::string_dup (L"")) { } @@ -192,13 +192,12 @@ TAO_SeqElem_String_Manager::_retn (void) return temp; } -#if 0 /* To be included once we have support for WString_var */ // **************************************************************** // default CTOR initializes to empty string ACE_INLINE TAO_WString_Manager::TAO_WString_Manager (void) - : ptr_ (CORBA::wstring_dup ("")) + : ptr_ (0) // @@ TODO CORBA::wstring_dup ("")) { } @@ -228,15 +227,6 @@ TAO_WString_Manager::operator= (const TAO_WString_Manager &rhs) return *this; } -// assignment from CORBA::String_var makes a copy -ACE_INLINE TAO_WString_Manager& -TAO_WString_Manager::operator= (const CORBA::String_var &var) -{ - CORBA::string_free (this->ptr_); - this->ptr_ = CORBA::wstring_dup (var.in ()); - return *this; -} - // assignment from const CORBA::WChar* makes a copy ACE_INLINE TAO_WString_Manager & TAO_WString_Manager::operator= (const CORBA::WChar * p) @@ -292,8 +282,9 @@ TAO_WString_Manager::_retn (void) // **************************************************************** ACE_INLINE -TAO_SeqElem_WString_Manager::TAO_SeqElem_WString_Manager (CORBA::WChar **buffer, - CORBA::Boolean release) +TAO_SeqElem_WString_Manager:: + TAO_SeqElem_WString_Manager (CORBA::WChar **buffer, + CORBA::Boolean release) : ptr_ (buffer), release_ (release) { @@ -317,16 +308,6 @@ TAO_SeqElem_WString_Manager::operator= (const TAO_SeqElem_WString_Manager &rhs) return *this; } -// assignment from String_var -ACE_INLINE TAO_SeqElem_WString_Manager& -TAO_SeqElem_WString_Manager::operator= (const CORBA::wstring_var &var) -{ - if (this->release_) - CORBA::wstring_free (*this->ptr_); - *this->ptr_ = CORBA::wstring_dup (var.in ()); - return *this; -} - // assignment from const CORBA::WChar* will make copy ACE_INLINE TAO_SeqElem_WString_Manager & TAO_SeqElem_WString_Manager::operator= (const CORBA::WChar *p) @@ -380,5 +361,3 @@ TAO_SeqElem_WString_Manager::_retn (void) *this->ptr_ = 0; return temp; } - -#endif /* 0 */ diff --git a/TAO/tao/Marshal.i b/TAO/tao/Marshal.i index 7a584dd82c5..1d95143e76d 100644 --- a/TAO/tao/Marshal.i +++ b/TAO/tao/Marshal.i @@ -193,8 +193,8 @@ TAO_Marshal_String::deep_free (CORBA::TypeCode_ptr, const void *, CORBA::Environment &) { - CORBA::string_free (*(CORBA::String *) source); - *(CORBA::String *)source = 0; + CORBA::string_free (*(CORBA::Char* *) source); + *(CORBA::Char* *)source = 0; return CORBA::TypeCode::TRAVERSE_CONTINUE; } @@ -205,7 +205,7 @@ TAO_Marshal_WString::deep_free (CORBA::TypeCode_ptr, const void *, CORBA::Environment &) { - CORBA::wstring_free (*(CORBA::WString *) source); - *(CORBA::WString *)source = 0; + CORBA::wstring_free (*(CORBA::WChar* *) source); + *(CORBA::WChar* *)source = 0; return CORBA::TypeCode::TRAVERSE_CONTINUE; } diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 40d6695310c..a829acc5d9f 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -79,27 +79,7 @@ int CORBA_ORB::orb_init_count_ = 0; // Pointer to the "default ORB." CORBA::ORB_ptr CORBA::instance_ = 0; -CORBA_String_var::CORBA_String_var (char *p) - : ptr_ (p) -{ - // NOTE: According to the CORBA spec this string must *not* be - // copied, but it is non-compliant to use it/release it in the - // calling code. argument is consumed. p should never be NULL -} - -CORBA_String_var::CORBA_String_var (const CORBA_String_var& r) -{ - this->ptr_ = CORBA::string_dup (r.ptr_); -} - -CORBA_String_var::~CORBA_String_var (void) -{ - if (this->ptr_ != 0) - { - CORBA::string_free (this->ptr_); - this->ptr_ = 0; - } -} +// **************************************************************** CORBA_ORB::InvalidName::InvalidName (void) { @@ -984,7 +964,7 @@ CORBA_ORB::create_stub_object (const TAO_ObjectKey &key, CORBA::String id = 0; if (type_id) - id = CORBA::string_copy (type_id); + id = CORBA::string_dup (type_id); TAO_Stub *stub = 0; @@ -1115,22 +1095,37 @@ CORBA_ORB::create_dyn_enum (CORBA_TypeCode_ptr tc, #endif /* TAO_HAS_MINIMUM_CORBA */ +// **************************************************************** + // String utility support; this needs to be integrated with the ORB's // own memory allocation subsystem. -CORBA::String +CORBA::Char* CORBA::string_copy (const CORBA::Char *str) { - if (!str) - return 0; + return CORBA::string_dup (str); +} - size_t len = ACE_OS::strlen (str); +CORBA_String_var::CORBA_String_var (char *p) + : ptr_ (p) +{ + // NOTE: According to the CORBA spec this string must *not* be + // copied, but it is non-compliant to use it/release it in the + // calling code. argument is consumed. p should never be NULL +} - // This allocates an extra byte for the '\0'; - CORBA::String copy = CORBA::string_alloc (len); +CORBA_String_var::CORBA_String_var (const CORBA_String_var& r) +{ + this->ptr_ = CORBA::string_dup (r.ptr_); +} - ACE_OS::memcpy (copy, str, len + 1); - return copy; +CORBA_String_var::~CORBA_String_var (void) +{ + if (this->ptr_ != 0) + { + CORBA::string_free (this->ptr_); + this->ptr_ = 0; + } } CORBA_String_var & @@ -1167,31 +1162,66 @@ CORBA_String_var::operator= (const CORBA_String_var& r) return *this; } -// Wide Character string utility support; this can need to be -// integrated with the ORB's own memory allocation subsystem. +// **************************************************************** -CORBA::WString -CORBA::wstring_alloc (CORBA::ULong len) +CORBA_WString_var::CORBA_WString_var (CORBA::WChar *p) + : ptr_ (p) { - return new CORBA::WChar [(size_t) (len + 1)]; + // NOTE: According to the CORBA spec this string must *not* be + // copied, but it is non-compliant to use it/release it in the + // calling code. argument is consumed. p should never be NULL } -CORBA::WString -CORBA::wstring_copy (const CORBA::WChar *const str) +CORBA_WString_var::CORBA_WString_var (const CORBA_WString_var& r) { - if (!str) - return 0; + this->ptr_ = CORBA::wstring_dup (r.ptr_); +} - CORBA::WString retval = CORBA::wstring_alloc (ACE_OS::wslen (str)); - return ACE_OS::wscpy (retval, str); +CORBA_WString_var::~CORBA_WString_var (void) +{ + if (this->ptr_ != 0) + { + CORBA::wstring_free (this->ptr_); + this->ptr_ = 0; + } } -void -CORBA::wstring_free (CORBA::WChar *const str) +CORBA_WString_var & +CORBA_WString_var::operator= (CORBA::WChar *p) { - delete [] str; + if (this->ptr_ != p) + { + if (this->ptr_ != 0) + CORBA::wstring_free (this->ptr_); + this->ptr_ = p; + } + return *this; +} + +CORBA_WString_var & +CORBA_WString_var::operator= (const CORBA::WChar *p) +{ + if (this->ptr_ != 0) + CORBA::wstring_free (this->ptr_); + + this->ptr_ = CORBA::wstring_dup (p); + return *this; } +CORBA_WString_var & +CORBA_WString_var::operator= (const CORBA_WString_var& r) +{ + if (this != &r) + { + if (this->ptr_ != 0) + CORBA::wstring_free (this->ptr_); + this->ptr_ = CORBA::wstring_dup (r.ptr_); + } + return *this; +} + +// **************************************************************** + void CORBA_ORB::init_orb_globals (CORBA::Environment &ACE_TRY_ENV) { diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index ab0a411549b..ff45b06fdd1 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -206,6 +206,115 @@ private: void operator= (const CORBA_String_var &); }; +// **************************************************************** + +class TAO_Export CORBA_WString_var +{ + // = TITLE + // CORBA_WString var class. Provides automatic deallocation of + // storage for wide strings + // +public: + CORBA_WString_var (void); + // default constructor. + + CORBA_WString_var (CORBA::WChar *p); + // constructor, owns p. + + CORBA_WString_var (const CORBA::WChar *p); + // constructor. Makes a copy of p. + + CORBA_WString_var (const CORBA_WString_var &s); + // copy constructor. + + ~CORBA_WString_var (void); + // destructor. + + CORBA_WString_var &operator= (CORBA::WChar *p); + // assignment operator. + + CORBA_WString_var &operator= (const CORBA::WChar *p); + // assignment to a const char*. Makes a copy. + + CORBA_WString_var &operator= (const CORBA_WString_var &s); + // assignment operator. + + operator CORBA::WChar *(); + // access and modify. + + operator const CORBA::WChar *() const; + // only read privileges. + + CORBA::WChar &operator[] (CORBA::ULong index); + // allows access and modification using an index. + + CORBA::WChar operator[] (CORBA::ULong index) const; + // allows only accessing thru an index. + + // = in, out, out, and _retn operations. + // ORBOS/97-05-15, Appendix C.2 + + const CORBA::WChar *in (void) const; + // for in parameter. + + CORBA::WChar *&inout (void); + // for inout parameter. + + CORBA::WChar *&out (void); + // for out parameter. + + CORBA::WChar *_retn (void); + // for string of return type. + +private: + CORBA::WChar *ptr_; + // instance. +}; + +class TAO_Export CORBA_WString_out +{ + // = TITLE + // CORBA_WString_out + // + // = DESCRIPTION + // To support the memory management for "out" parameter passing + // mode. ORBOS/97-05-15, Appendix C.2 defines a CORBA_WString_out + // class + // +public: + // = operations. + + CORBA_WString_out (CORBA::WChar *&p); + // Construction from a reference to a string. + + CORBA_WString_out (CORBA_WString_var &p); + // Construction from a var. + + CORBA_WString_out (const CORBA_WString_out &s); + // Copy constructor. + + CORBA_WString_out &operator= (const CORBA_WString_out &s); + // Assignment from a string_out. + + CORBA_WString_out &operator= (CORBA::WChar *p); + // Assignment from a string. + + operator CORBA::WChar *&(); + // Cast. + + CORBA::WChar *&ptr (void); + // Return underlying instance. + +private: + CORBA::WChar *&ptr_; + // Instance. + + // assignment from _var disallowed + void operator= (const CORBA_WString_var &); +}; + +// **************************************************************** + class TAO_Export CORBA_ORB { // = TITLE diff --git a/TAO/tao/ORB.i b/TAO/tao/ORB.i index 45ffe650154..7307b6c30e9 100644 --- a/TAO/tao/ORB.i +++ b/TAO/tao/ORB.i @@ -1,9 +1,6 @@ // -*- c++ -*- // $Id$ -// String utility support. Since these are static methods we need to -// explicitly export them from the DLL. - // ---------------------------------------------------------------------- // String_var type // ---------------------------------------------------------------------- @@ -16,7 +13,7 @@ CORBA_String_var::CORBA_String_var (void) ACE_INLINE CORBA_String_var::CORBA_String_var (const char *p) - : ptr_ (CORBA::string_dup ((char *) p)) + : ptr_ (CORBA::string_dup (p)) { } @@ -123,6 +120,129 @@ CORBA_String_out::ptr (void) return this->ptr_; } +// **************************************************************** + +// ---------------------------------------------------------------------- +// String_var type +// ---------------------------------------------------------------------- + +ACE_INLINE +CORBA_WString_var::CORBA_WString_var (void) +{ + this->ptr_ = 0; +} + +ACE_INLINE +CORBA_WString_var::CORBA_WString_var (const CORBA::WChar *p) + : ptr_ (CORBA::wstring_dup (p)) +{ +} + +ACE_INLINE CORBA::WChar & +CORBA_WString_var::operator[] (CORBA::ULong index) +{ + // We need to verify bounds else raise some exception. + return this->ptr_[index]; +} + +ACE_INLINE CORBA::WChar +CORBA_WString_var::operator[] (CORBA::ULong index) const +{ + // We need to verify bounds else raise some exception. + return this->ptr_[index]; +} + +ACE_INLINE +CORBA_WString_var::operator CORBA::WChar *() +{ + return this->ptr_; +} + +ACE_INLINE +CORBA_WString_var::operator const CORBA::WChar *() const +{ + return this->ptr_; +} + +ACE_INLINE const CORBA::WChar * +CORBA_WString_var::in (void) const +{ + return this->ptr_; +} + +ACE_INLINE CORBA::WChar *& +CORBA_WString_var::inout (void) +{ + return this->ptr_; +} + +ACE_INLINE CORBA::WChar *& +CORBA_WString_var::out (void) +{ + CORBA::wstring_free (this->ptr_); + this->ptr_ = 0; + return this->ptr_; +} + +ACE_INLINE CORBA::WChar * +CORBA_WString_var::_retn (void) +{ + CORBA::WChar *temp = this->ptr_; + this->ptr_ = 0; + return temp; +} + +// ---------------------------------------------------- +// String_out type +// ---------------------------------------------------- + +ACE_INLINE +CORBA_WString_out::CORBA_WString_out (CORBA::WChar *&s) + : ptr_ (s) +{ + this->ptr_ = 0; +} + +ACE_INLINE +CORBA_WString_out::CORBA_WString_out (CORBA_WString_var &s) + : ptr_ (s.out ()) +{ +} + +ACE_INLINE +CORBA_WString_out::CORBA_WString_out (const CORBA_WString_out &s) + : ptr_ (s.ptr_) +{ +} + +ACE_INLINE CORBA_WString_out & +CORBA_WString_out::operator= (const CORBA_WString_out &s) +{ + this->ptr_ = s.ptr_; + return *this; +} + +ACE_INLINE CORBA_WString_out & +CORBA_WString_out::operator= (CORBA::WChar *s) +{ + this->ptr_ = s; + return *this; +} + +ACE_INLINE +CORBA_WString_out::operator CORBA::WChar *&() +{ + return this->ptr_; +} + +ACE_INLINE CORBA::WChar *& +CORBA_WString_out::ptr (void) +{ + return this->ptr_; +} + +// **************************************************************** + // --------------------------------------------------------------------------- // ORB specific // --------------------------------------------------------------------------- diff --git a/TAO/tao/POA.cpp b/TAO/tao/POA.cpp index 359d1322b11..36fe0daeb87 100644 --- a/TAO/tao/POA.cpp +++ b/TAO/tao/POA.cpp @@ -1913,8 +1913,8 @@ TAO_POA::create_object_key (const PortableServer::ObjectId &id) #if !defined (TAO_NO_IOR_TABLE) // Add the object key prefix. ACE_OS::memcpy (&buffer[starting_at], - &objectkey_prefix[0], - TAO_OBJECTKEY_PREFIX_SIZE); + &objectkey_prefix[0], + TAO_OBJECTKEY_PREFIX_SIZE); starting_at += TAO_OBJECTKEY_PREFIX_SIZE; #endif /* TAO_NO_IOR_TABLE */ @@ -2135,7 +2135,7 @@ CORBA::WChar * TAO_POA::ObjectId_to_wstring (const PortableServer::ObjectId &id) { // Create space - CORBA::WString string = CORBA::wstring_alloc (id.length ()); + CORBA::WChar* string = CORBA::wstring_alloc (id.length ()); // Copy the data ACE_OS::memcpy (string, id.get_buffer (), id.length () * sizeof (CORBA::WChar)); diff --git a/TAO/tao/POA.h b/TAO/tao/POA.h index 5555ec743ad..5ab4c0b72ce 100644 --- a/TAO/tao/POA.h +++ b/TAO/tao/POA.h @@ -488,9 +488,9 @@ public: static void decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq, const char *str); - static CORBA::String ObjectId_to_string (const PortableServer::ObjectId &id); + static char* ObjectId_to_string (const PortableServer::ObjectId &id); - static CORBA::WString ObjectId_to_wstring (const PortableServer::ObjectId &id); + static CORBA::WChar* ObjectId_to_wstring (const PortableServer::ObjectId &id); static PortableServer::ObjectId *string_to_ObjectId (const char *id); diff --git a/TAO/tao/Request.cpp b/TAO/tao/Request.cpp index db2567eb69e..519ee4c479a 100644 --- a/TAO/tao/Request.cpp +++ b/TAO/tao/Request.cpp @@ -66,7 +66,7 @@ CORBA_Request::CORBA_Request (CORBA::Object_ptr obj, refcount_ (1) { target_ = CORBA::Object::_duplicate (obj); - opname_ = CORBA::string_copy (op); + opname_ = CORBA::string_dup (op); } CORBA_Request::CORBA_Request (CORBA::Object_ptr obj, @@ -79,7 +79,7 @@ CORBA_Request::CORBA_Request (CORBA::Object_ptr obj, refcount_ (1) { target_ = CORBA::Object::_duplicate (obj); - opname_ = CORBA::string_copy (op); + opname_ = CORBA::string_dup (op); ACE_NEW (args_, CORBA::NVList); ACE_NEW (result_, CORBA::NamedValue); diff --git a/TAO/tao/Typecode_Constants.cpp b/TAO/tao/Typecode_Constants.cpp index 1c03d909de4..664cf642e83 100644 --- a/TAO/tao/Typecode_Constants.cpp +++ b/TAO/tao/Typecode_Constants.cpp @@ -201,7 +201,7 @@ TAO_TypeCodes::init (void) sizeof _oc_wstring, (char *) &_oc_wstring, 1, - sizeof (CORBA::WString)); + sizeof (CORBA::WChar*)); // // Various things that can be passed as "general" parameters: @@ -376,7 +376,7 @@ TAO_TypeCodes::init (void) ACE_NTOHL (0x412f4f62), ACE_NTOHL (0x6a656374), ACE_NTOHL (0x49643a31), - ACE_NTOHL (0x2e300000), // repository ID = + ACE_NTOHL (0x2e300000), // repository ID = // IDL:omg.org/CORBA/ObjectId:1.0 9, ACE_NTOHL (0x4f626a65), @@ -430,55 +430,55 @@ TAO_TypeCodes::init (void) static const CORBA::Long _oc_CORBA_ConstructionPolicy[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 41, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f436f), - ACE_NTOHL (0x6e737472), - ACE_NTOHL (0x75637469), - ACE_NTOHL (0x6f6e506f), - ACE_NTOHL (0x6c696379), - ACE_NTOHL (0x3a312e30), - ACE_NTOHL (0x0), // repository ID = + 41, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f436f), + ACE_NTOHL (0x6e737472), + ACE_NTOHL (0x75637469), + ACE_NTOHL (0x6f6e506f), + ACE_NTOHL (0x6c696379), + ACE_NTOHL (0x3a312e30), + ACE_NTOHL (0x0), // repository ID = // IDL:omg.org/CORBA/ConstructionPolicy:1.0 - 19, - ACE_NTOHL (0x436f6e73), - ACE_NTOHL (0x74727563), - ACE_NTOHL (0x74696f6e), - ACE_NTOHL (0x506f6c69), + 19, + ACE_NTOHL (0x436f6e73), + ACE_NTOHL (0x74727563), + ACE_NTOHL (0x74696f6e), + ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63790000), // name = ConstructionPolicy, }; - CORBA::_tc_ConstructionPolicy = - new CORBA::TypeCode (CORBA::tk_objref, - sizeof (_oc_CORBA_ConstructionPolicy), - (char *) &_oc_CORBA_ConstructionPolicy, - 0, + CORBA::_tc_ConstructionPolicy = + new CORBA::TypeCode (CORBA::tk_objref, + sizeof (_oc_CORBA_ConstructionPolicy), + (char *) &_oc_CORBA_ConstructionPolicy, + 0, sizeof (CORBA::ConstructionPolicy)); static const CORBA::Long _oc_corba_NamedValue[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 33, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x636f7262), - ACE_NTOHL (0x612f4e61), - ACE_NTOHL (0x6d656456), - ACE_NTOHL (0x616c7565), - ACE_NTOHL (0x3a312e30), - ACE_NTOHL (0x0), // repository ID = + 33, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x636f7262), + ACE_NTOHL (0x612f4e61), + ACE_NTOHL (0x6d656456), + ACE_NTOHL (0x616c7565), + ACE_NTOHL (0x3a312e30), + ACE_NTOHL (0x0), // repository ID = // IDL:omg.org/corba/NamedValue:1.0 - 11, - ACE_NTOHL (0x4e616d65), - ACE_NTOHL (0x6456616c), + 11, + ACE_NTOHL (0x4e616d65), + ACE_NTOHL (0x6456616c), ACE_NTOHL (0x75650000), // name = NamedValue, }; - CORBA::_tc_NamedValue = + CORBA::_tc_NamedValue = new CORBA::TypeCode (CORBA::tk_objref, sizeof (_oc_corba_NamedValue), (char *) &_oc_corba_NamedValue, @@ -488,42 +488,42 @@ TAO_TypeCodes::init (void) static const CORBA::Long _oc_CORBA_NameValuePair[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 28, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f4e61), - ACE_NTOHL (0x6d655661), - ACE_NTOHL (0x6c756550), - ACE_NTOHL (0x6169723a), - ACE_NTOHL (0x312e3000), // repository ID = + 28, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f4e61), + ACE_NTOHL (0x6d655661), + ACE_NTOHL (0x6c756550), + ACE_NTOHL (0x6169723a), + ACE_NTOHL (0x312e3000), // repository ID = // IDL:CORBA/NameValuePair:1.0 - 14, - ACE_NTOHL (0x4e616d65), - ACE_NTOHL (0x56616c75), - ACE_NTOHL (0x65506169), + 14, + ACE_NTOHL (0x4e616d65), + ACE_NTOHL (0x56616c75), + ACE_NTOHL (0x65506169), ACE_NTOHL (0x72000000), // name = NameValuePair 2, // member count - 3, + 3, ACE_NTOHL (0x69640000), // name = id CORBA::tk_alias, // typecode kind for typedefs 56, // encapsulation length TAO_ENCAP_BYTE_ORDER, // byte order - 24, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f4669), - ACE_NTOHL (0x656c644e), - ACE_NTOHL (0x616d653a), - ACE_NTOHL (0x312e3000), // repository ID = + 24, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f4669), + ACE_NTOHL (0x656c644e), + ACE_NTOHL (0x616d653a), + ACE_NTOHL (0x312e3000), // repository ID = // IDL:CORBA/FieldName:1.0 - 10, - ACE_NTOHL (0x4669656c), - ACE_NTOHL (0x644e616d), + 10, + ACE_NTOHL (0x4669656c), + ACE_NTOHL (0x644e616d), ACE_NTOHL (0x65000000), // name = FieldName - CORBA::tk_string, + CORBA::tk_string, 0, // string length - 6, - ACE_NTOHL (0x76616c75), + 6, + ACE_NTOHL (0x76616c75), ACE_NTOHL (0x65000000), // name = value CORBA::tk_any, }; @@ -538,20 +538,20 @@ TAO_TypeCodes::init (void) static const CORBA::Long _oc_CORBA_NameValuePairSeq[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 31, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f4e61), - ACE_NTOHL (0x6d655661), - ACE_NTOHL (0x6c756550), - ACE_NTOHL (0x61697253), - ACE_NTOHL (0x65713a31), + 31, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f4e61), + ACE_NTOHL (0x6d655661), + ACE_NTOHL (0x6c756550), + ACE_NTOHL (0x61697253), + ACE_NTOHL (0x65713a31), ACE_NTOHL (0x2e300000), // repository ID = IDL:CORBA/NameValuePairSeq:1.0 - 17, - ACE_NTOHL (0x4e616d65), - ACE_NTOHL (0x56616c75), - ACE_NTOHL (0x65506169), - ACE_NTOHL (0x72536571), + 17, + ACE_NTOHL (0x4e616d65), + ACE_NTOHL (0x56616c75), + ACE_NTOHL (0x65506169), + ACE_NTOHL (0x72536571), ACE_NTOHL (0x0), // name = NameValuePairSeq CORBA::tk_sequence, // typecode kind 164, // encapsulation length @@ -559,93 +559,93 @@ TAO_TypeCodes::init (void) CORBA::tk_struct, // typecode kind 148, // encapsulation length TAO_ENCAP_BYTE_ORDER, // byte order - 28, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f4e61), - ACE_NTOHL (0x6d655661), - ACE_NTOHL (0x6c756550), - ACE_NTOHL (0x6169723a), + 28, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f4e61), + ACE_NTOHL (0x6d655661), + ACE_NTOHL (0x6c756550), + ACE_NTOHL (0x6169723a), ACE_NTOHL (0x312e3000), // repository ID = IDL:CORBA/NameValuePair:1.0 - 14, - ACE_NTOHL (0x4e616d65), - ACE_NTOHL (0x56616c75), - ACE_NTOHL (0x65506169), + 14, + ACE_NTOHL (0x4e616d65), + ACE_NTOHL (0x56616c75), + ACE_NTOHL (0x65506169), ACE_NTOHL (0x72000000), // name = NameValuePair 2, // member count - 3, + 3, ACE_NTOHL (0x69640000), // name = id CORBA::tk_alias, // typecode kind for typedefs 56, // encapsulation length TAO_ENCAP_BYTE_ORDER, // byte order - 24, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f4669), - ACE_NTOHL (0x656c644e), - ACE_NTOHL (0x616d653a), + 24, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f4669), + ACE_NTOHL (0x656c644e), + ACE_NTOHL (0x616d653a), ACE_NTOHL (0x312e3000), // repository ID = IDL:CORBA/FieldName:1.0 - 10, - ACE_NTOHL (0x4669656c), - ACE_NTOHL (0x644e616d), + 10, + ACE_NTOHL (0x4669656c), + ACE_NTOHL (0x644e616d), ACE_NTOHL (0x65000000), // name = FieldName - CORBA::tk_string, + CORBA::tk_string, 0, // string length - 6, - ACE_NTOHL (0x76616c75), + 6, + ACE_NTOHL (0x76616c75), ACE_NTOHL (0x65000000), // name = value CORBA::tk_any, 0, }; CORBA::_tc_NameValuePairSeq = - new CORBA::TypeCode (CORBA::tk_alias, - sizeof (_oc_CORBA_NameValuePairSeq), - (char *) &_oc_CORBA_NameValuePairSeq, - 0, + new CORBA::TypeCode (CORBA::tk_alias, + sizeof (_oc_CORBA_NameValuePairSeq), + (char *) &_oc_CORBA_NameValuePairSeq, + 0, sizeof (CORBA::NameValuePairSeq)); static const CORBA::Long _oc_CORBA_WrongTransaction[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 39, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f5772), - ACE_NTOHL (0x6f6e6754), - ACE_NTOHL (0x72616e73), - ACE_NTOHL (0x61637469), - ACE_NTOHL (0x6f6e3a31), - ACE_NTOHL (0x2e300000), // repository ID = + 39, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f5772), + ACE_NTOHL (0x6f6e6754), + ACE_NTOHL (0x72616e73), + ACE_NTOHL (0x61637469), + ACE_NTOHL (0x6f6e3a31), + ACE_NTOHL (0x2e300000), // repository ID = // IDL:omg.org/CORBA/WrongTransaction:1.0 - 17, - ACE_NTOHL (0x57726f6e), - ACE_NTOHL (0x67547261), - ACE_NTOHL (0x6e736163), - ACE_NTOHL (0x74696f6e), + 17, + ACE_NTOHL (0x57726f6e), + ACE_NTOHL (0x67547261), + ACE_NTOHL (0x6e736163), + ACE_NTOHL (0x74696f6e), ACE_NTOHL (0x0), // name = WrongTransaction 0, // member count }; CORBA::_tc_WrongTransaction = - new CORBA::TypeCode (CORBA::tk_except, - sizeof (_oc_CORBA_WrongTransaction), - (char *) &_oc_CORBA_WrongTransaction, - 0, + new CORBA::TypeCode (CORBA::tk_except, + sizeof (_oc_CORBA_WrongTransaction), + (char *) &_oc_CORBA_WrongTransaction, + 0, sizeof (CORBA::WrongTransaction)); static const CORBA::Long _oc_CORBA_AnySeq[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 21, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f416e), - ACE_NTOHL (0x79536571), - ACE_NTOHL (0x3a312e30), + 21, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f416e), + ACE_NTOHL (0x79536571), + ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0), // repository ID = IDL:CORBA/AnySeq:1.0 - 7, - ACE_NTOHL (0x416e7953), + 7, + ACE_NTOHL (0x416e7953), ACE_NTOHL (0x65710000), // name = AnySeq CORBA::tk_sequence, // typecode kind 12, // encapsulation length @@ -664,18 +664,18 @@ TAO_TypeCodes::init (void) static const CORBA::Long _oc_CORBA_FieldName[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 24, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f4669), - ACE_NTOHL (0x656c644e), - ACE_NTOHL (0x616d653a), + 24, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f4669), + ACE_NTOHL (0x656c644e), + ACE_NTOHL (0x616d653a), ACE_NTOHL (0x312e3000), // repository ID = IDL:CORBA/FieldName:1.0 - 10, - ACE_NTOHL (0x4669656c), - ACE_NTOHL (0x644e616d), + 10, + ACE_NTOHL (0x4669656c), + ACE_NTOHL (0x644e616d), ACE_NTOHL (0x65000000), // name = FieldName - CORBA::tk_string, + CORBA::tk_string, 0, // string length }; CORBA::_tc_FieldName = @@ -700,7 +700,7 @@ TAO_TypeCodes::init (void) ACE_NTOHL (0x72766963), ACE_NTOHL (0x654f7074), ACE_NTOHL (0x696f6e3a), - ACE_NTOHL (0x312e3000), // repository ID = + ACE_NTOHL (0x312e3000), // repository ID = // IDL:omg.org/CORBA/ServiceOption:1.0 14, ACE_NTOHL (0x53657276), @@ -961,7 +961,7 @@ TAO_TypeCodes::init (void) sizeof (_oc_CORBA_ServiceInformation), (char *) &_oc_CORBA_ServiceInformation, 0, - sizeof (CORBA::ServiceInformation)); + sizeof (CORBA::ServiceInformation)); // **************************************************************** @@ -1324,51 +1324,51 @@ TAO_TypeCodes::init (void) static const CORBA::Long _oc_CORBA_DomainManager[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 36, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f446f), - ACE_NTOHL (0x6d61696e), - ACE_NTOHL (0x4d616e61), - ACE_NTOHL (0x6765723a), - ACE_NTOHL (0x312e3000), // repository ID = + 36, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f446f), + ACE_NTOHL (0x6d61696e), + ACE_NTOHL (0x4d616e61), + ACE_NTOHL (0x6765723a), + ACE_NTOHL (0x312e3000), // repository ID = //IDL:omg.org/CORBA/DomainManager:1.0 - 14, - ACE_NTOHL (0x446f6d61), - - ACE_NTOHL (0x696e4d61), - ACE_NTOHL (0x6e616765), + 14, + ACE_NTOHL (0x446f6d61), + + ACE_NTOHL (0x696e4d61), + ACE_NTOHL (0x6e616765), ACE_NTOHL (0x72000000), // name = DomainManager, }; - CORBA::_tc_DomainManager = + CORBA::_tc_DomainManager = new CORBA::TypeCode (CORBA::tk_objref, - sizeof (_oc_CORBA_DomainManager), - (char *) &_oc_CORBA_DomainManager, - 0, + sizeof (_oc_CORBA_DomainManager), + (char *) &_oc_CORBA_DomainManager, + 0, sizeof (CORBA_DomainManager)); static const CORBA::Long _oc_CORBA_DomainManagerList[] = { TAO_ENCAP_BYTE_ORDER, // byte order - 40, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f446f), - ACE_NTOHL (0x6d61696e), - ACE_NTOHL (0x4d616e61), - ACE_NTOHL (0x6765724c), - ACE_NTOHL (0x6973743a), - ACE_NTOHL (0x312e3000), // repository ID = + 40, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f446f), + ACE_NTOHL (0x6d61696e), + ACE_NTOHL (0x4d616e61), + ACE_NTOHL (0x6765724c), + ACE_NTOHL (0x6973743a), + ACE_NTOHL (0x312e3000), // repository ID = //IDL:omg.org/CORBA/DomainManagerList:1.0 - 18, - ACE_NTOHL (0x446f6d61), - ACE_NTOHL (0x696e4d61), - ACE_NTOHL (0x6e616765), - ACE_NTOHL (0x724c6973), + 18, + ACE_NTOHL (0x446f6d61), + ACE_NTOHL (0x696e4d61), + ACE_NTOHL (0x6e616765), + ACE_NTOHL (0x724c6973), ACE_NTOHL (0x74000000), // name = DomainManagerList CORBA::tk_sequence, // typecode kind 80, // encapsulation length @@ -1376,29 +1376,29 @@ TAO_TypeCodes::init (void) CORBA::tk_objref, // typecode kind 64, // encapsulation length TAO_ENCAP_BYTE_ORDER, // byte order - 36, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x434f5242), - ACE_NTOHL (0x412f446f), - ACE_NTOHL (0x6d61696e), - ACE_NTOHL (0x4d616e61), - ACE_NTOHL (0x6765723a), - ACE_NTOHL (0x312e3000), // repository ID = + 36, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x434f5242), + ACE_NTOHL (0x412f446f), + ACE_NTOHL (0x6d61696e), + ACE_NTOHL (0x4d616e61), + ACE_NTOHL (0x6765723a), + ACE_NTOHL (0x312e3000), // repository ID = //IDL:omg.org/CORBA/DomainManager:1.0 - 14, - ACE_NTOHL (0x446f6d61), - ACE_NTOHL (0x696e4d61), - ACE_NTOHL (0x6e616765), + 14, + ACE_NTOHL (0x446f6d61), + ACE_NTOHL (0x696e4d61), + ACE_NTOHL (0x6e616765), ACE_NTOHL (0x72000000), // name = DomainManager, 0, }; - CORBA::_tc_DomainManagerList = - new CORBA::TypeCode (CORBA::tk_alias, - sizeof (_oc_CORBA_DomainManagerList), - (char *) &_oc_CORBA_DomainManagerList, - 0, + CORBA::_tc_DomainManagerList = + new CORBA::TypeCode (CORBA::tk_alias, + sizeof (_oc_CORBA_DomainManagerList), + (char *) &_oc_CORBA_DomainManagerList, + 0, sizeof (CORBA_DomainManagerList)); // **************************************************************** diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index 7e3adcbc16d..cad767c234f 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -258,6 +258,8 @@ class CORBA_DefaultValueRefCountBase; class CORBA_String_var; class CORBA_String_out; +class CORBA_WString_var; +class CORBA_WString_out; class CORBA_ExceptionList; @@ -336,9 +338,6 @@ typedef void (*TAO_Skeleton)( template <class T> class TAO_Unbounded_Sequence; template <class T> class TAO_Unbounded_Object_Sequence; -class CORBA_String_var; -class CORBA_String_out; - class TAO_Export CORBA { // = TITLE @@ -390,31 +389,31 @@ public: typedef Char *String; // = String memory management. - static String string_alloc (ULong len); - static String string_copy (const Char *); - static String string_dup (const Char *); + static Char* string_alloc (ULong len); + static Char* string_dup (const Char *); static void string_free (Char *); - - typedef TAO_Unbounded_Sequence<Octet> OctetSeq; + // This is a TAO extension and must go away.... + static Char* string_copy (const Char *); typedef CORBA_String_var String_var; typedef CORBA_String_out String_out; - // WChar is an IDL extension, not yet standard. We use 32 bits - // because that's what many platforms use for their native wchar_t. + // WChar was standarized in CORBA 2.2, but is still a bit unstable. typedef ACE_CDR::WChar WChar; - typedef WChar *WString; - typedef WChar &WChar_out; // Out type for WChar. // = String memory management routines. - static WString wstring_alloc (ULong len); - static WString wstring_copy (const WChar *const); - static WString wstring_dup (const WChar *const); + static WChar* wstring_alloc (ULong len); + static WChar* wstring_dup (const WChar *const); static void wstring_free (WChar *const); + typedef CORBA_WString_var WString_var; + typedef CORBA_WString_out WString_out; + + typedef TAO_Unbounded_Sequence<Octet> OctetSeq; + // = various CORBA defined classes. typedef CORBA_Any Any; typedef CORBA_Any_var Any_var; @@ -442,7 +441,7 @@ public: typedef NamedValue *NamedValue_ptr; typedef CORBA_NamedValue_var NamedValue_var; typedef CORBA_NamedValue_out NamedValue_out; - + typedef CORBA_NVList NVList; typedef NVList *NVList_ptr; typedef CORBA_NVList_var NVList_var; diff --git a/TAO/tao/corbafwd.i b/TAO/tao/corbafwd.i index b9e4789de9c..766b0ee6a30 100644 --- a/TAO/tao/corbafwd.i +++ b/TAO/tao/corbafwd.i @@ -16,16 +16,41 @@ CORBA::string_free (CORBA::Char *str) ACE_INLINE TAO_Export CORBA::String CORBA::string_dup (const CORBA::Char *str) { - return CORBA::string_copy (str); + if (!str) + return 0; + + size_t len = ACE_OS::strlen (str); + + // This allocates an extra byte for the '\0'; + CORBA::String copy = CORBA::string_alloc (len); + + ACE_OS::memcpy (copy, str, len + 1); + return copy; } // ---------------------------------------------------------------------- // Wide strings // ---------------------------------------------------------------------- -ACE_INLINE TAO_Export CORBA::WString +ACE_INLINE TAO_Export CORBA::WChar* +CORBA::wstring_alloc (CORBA::ULong len) +{ + return new CORBA::WChar [(size_t) (len + 1)]; +} + +ACE_INLINE TAO_Export void +CORBA::wstring_free (CORBA::WChar *const str) +{ + delete [] str; +} + +ACE_INLINE TAO_Export CORBA::WChar* CORBA::wstring_dup (const WChar *const str) { - return CORBA::wstring_copy (str); + if (!str) + return 0; + + CORBA::WChar* retval = CORBA::wstring_alloc (ACE_OS::wslen (str)); + return ACE_OS::wscpy (retval, str); } |