diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-28 00:57:45 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-28 00:57:45 +0000 |
commit | ffa00352dc807b8cb99459e7b444037bbbad5a57 (patch) | |
tree | ce078771a25158181c6bb14d16ad840272e493a4 | |
parent | 9e022a7ddd06f2ff07faebfc2034e29a573c11f6 (diff) | |
download | ATCD-ffa00352dc807b8cb99459e7b444037bbbad5a57.tar.gz |
ChangeLogTag: Thu Mar 27 18:55:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 11 | ||||
-rw-r--r-- | TAO/tao/Sequence.cpp | 148 | ||||
-rw-r--r-- | TAO/tao/Sequence.i | 162 | ||||
-rw-r--r-- | TAO/tao/TAO.dsp | 4 |
4 files changed, 188 insertions, 137 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 87e4764564c..3e38b094082 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,14 @@ +Thu Mar 27 18:55:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu> + + * tao/Sequence.cpp: + * tao/Sequence.h: + + Cosmetic changes. + + * tao/TAO.dsp: + + Added newly created inline files to the project. + Thu Mar 27 03:00:53 2003 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/ast/ast_predefined_type.cpp: diff --git a/TAO/tao/Sequence.cpp b/TAO/tao/Sequence.cpp index face7619d39..f17948d7ddd 100644 --- a/TAO/tao/Sequence.cpp +++ b/TAO/tao/Sequence.cpp @@ -24,16 +24,16 @@ void TAO_Base_Sequence::_shrink_buffer (CORBA::ULong, CORBA::ULong) } void -TAO_Base_Sequence::_downcast (void*, - CORBA::Object* +TAO_Base_Sequence::_downcast (void *, + CORBA::Object * ACE_ENV_ARG_DECL_NOT_USED) { // default is no op. // @@ TODO Maybe throw an exception? } -CORBA::Object* -TAO_Base_Sequence::_upcast (void*) const +CORBA::Object * +TAO_Base_Sequence::_upcast (void *) const { return 0; } @@ -68,7 +68,7 @@ TAO_Unbounded_String_Sequence::TAO_Unbounded_String_Sequence ( } TAO_Unbounded_String_Sequence::TAO_Unbounded_String_Sequence ( - const TAO_Unbounded_String_Sequence &rhs + const TAO_Unbounded_String_Sequence & rhs ) : TAO_Unbounded_Base_Sequence (rhs) { @@ -98,9 +98,10 @@ TAO_Unbounded_String_Sequence::~TAO_Unbounded_String_Sequence (void) this->_deallocate_buffer (); } -TAO_Unbounded_String_Sequence& -TAO_Unbounded_String_Sequence:: -operator= (const TAO_Unbounded_String_Sequence &rhs) +TAO_Unbounded_String_Sequence & +TAO_Unbounded_String_Sequence::operator= ( + const TAO_Unbounded_String_Sequence & rhs + ) { if (this == &rhs) { @@ -109,8 +110,8 @@ operator= (const TAO_Unbounded_String_Sequence &rhs) if (this->release_) { - char **tmp = ACE_reinterpret_cast (char **, - this->buffer_); + char ** tmp = ACE_reinterpret_cast (char **, + this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -120,7 +121,7 @@ operator= (const TAO_Unbounded_String_Sequence &rhs) if (this->maximum_ < rhs.maximum_) { - // free the older buffer + // Free the older buffer. TAO_Unbounded_String_Sequence::freebuf (tmp); this->buffer_ = TAO_Unbounded_String_Sequence::allocbuf (rhs.maximum_); @@ -141,7 +142,7 @@ operator= (const TAO_Unbounded_String_Sequence &rhs) TAO_Unbounded_Base_Sequence::operator= (rhs); - char **tmp1 = ACE_reinterpret_cast (char **, this->buffer_); + char ** tmp1 = ACE_reinterpret_cast (char **, this->buffer_); char ** const tmp2 = ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_); @@ -157,19 +158,19 @@ TAO_SeqElem_String_Manager TAO_Unbounded_String_Sequence::operator[] (CORBA::ULong slot) const { ACE_ASSERT (slot < this->maximum_); - char **const tmp = - ACE_reinterpret_cast (char **ACE_CAST_CONST, + char ** const tmp = + ACE_reinterpret_cast (char ** ACE_CAST_CONST, this->buffer_); return TAO_SeqElem_String_Manager (tmp + slot, this->release_); } -char* * +char ** TAO_Unbounded_String_Sequence::allocbuf (CORBA::ULong nelems) { - char **buf; + char ** buf = 0; ACE_NEW_RETURN (buf, - char *[nelems], + char * [nelems], 0); for (CORBA::ULong i = 0; i < nelems; ++i) @@ -181,7 +182,7 @@ TAO_Unbounded_String_Sequence::allocbuf (CORBA::ULong nelems) } void -TAO_Unbounded_String_Sequence::freebuf (char* *buffer) +TAO_Unbounded_String_Sequence::freebuf (char ** buffer) { if (buffer == 0) { @@ -214,10 +215,10 @@ TAO_Unbounded_String_Sequence::_tao_any_destructor ( delete tmp; } -char** +char ** TAO_Unbounded_String_Sequence::get_buffer (CORBA::Boolean orphan) { - char* *result = 0; + char ** result = 0; if (orphan == 0) { @@ -226,11 +227,11 @@ TAO_Unbounded_String_Sequence::get_buffer (CORBA::Boolean orphan) { result = allocbuf (this->length_); this->buffer_ = result; - this->release_ = 1; + this->release_ = 1; } else { - result = ACE_reinterpret_cast (char**, this->buffer_); + result = ACE_reinterpret_cast (char **, this->buffer_); } } else // if (orphan == 1) @@ -239,7 +240,7 @@ TAO_Unbounded_String_Sequence::get_buffer (CORBA::Boolean orphan) { // We set the state back to default and relinquish // ownership. - result = ACE_reinterpret_cast (char**, this->buffer_); + result = ACE_reinterpret_cast (char **, this->buffer_); this->maximum_ = 0; this->length_ = 0; this->buffer_ = 0; @@ -250,21 +251,21 @@ TAO_Unbounded_String_Sequence::get_buffer (CORBA::Boolean orphan) return result; } -const char** +const char ** TAO_Unbounded_String_Sequence::get_buffer (void) const { - return ACE_reinterpret_cast (const char** ACE_CAST_CONST, + return ACE_reinterpret_cast (const char ** ACE_CAST_CONST, this->buffer_); } void TAO_Unbounded_String_Sequence::_allocate_buffer (CORBA::ULong length) { - char* *tmp = TAO_Unbounded_String_Sequence::allocbuf (length); + char ** tmp = TAO_Unbounded_String_Sequence::allocbuf (length); if (this->buffer_ != 0) { - char* *old = ACE_reinterpret_cast (char **, this->buffer_); + char ** old = ACE_reinterpret_cast (char **, this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -300,7 +301,7 @@ TAO_Unbounded_String_Sequence::_deallocate_buffer (void) return; } - char **tmp = ACE_reinterpret_cast (char **, this->buffer_); + char ** tmp = ACE_reinterpret_cast (char **, this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -316,8 +317,8 @@ void TAO_Unbounded_String_Sequence::_shrink_buffer (CORBA::ULong nl, CORBA::ULong ol) { - char **tmp = ACE_reinterpret_cast (char **, - this->buffer_); + char ** tmp = ACE_reinterpret_cast (char **, + this->buffer_); for (CORBA::ULong i = nl; i < ol; ++i) { @@ -329,13 +330,13 @@ TAO_Unbounded_String_Sequence::_shrink_buffer (CORBA::ULong nl, void TAO_Unbounded_String_Sequence::replace (CORBA::ULong maximum, CORBA::ULong length, - char* *data, + char ** data, CORBA::Boolean release) { if (this->release_ == 1) { - char **tmp = ACE_reinterpret_cast (char **, - this->buffer_); + char ** tmp = ACE_reinterpret_cast (char **, + this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -366,13 +367,13 @@ TAO_Unbounded_WString_Sequence::TAO_Unbounded_WString_Sequence ( } TAO_Unbounded_WString_Sequence::TAO_Unbounded_WString_Sequence ( - const TAO_Unbounded_WString_Sequence &rhs + const TAO_Unbounded_WString_Sequence & rhs ) : TAO_Unbounded_Base_Sequence (rhs) { if (rhs.buffer_ != 0) { - CORBA::WChar* *tmp1 = + CORBA::WChar ** tmp1 = TAO_Unbounded_WString_Sequence::allocbuf (this->maximum_); CORBA::WChar ** const tmp2 = @@ -397,9 +398,10 @@ TAO_Unbounded_WString_Sequence::~TAO_Unbounded_WString_Sequence (void) this->_deallocate_buffer (); } -TAO_Unbounded_WString_Sequence& -TAO_Unbounded_WString_Sequence:: -operator= (const TAO_Unbounded_WString_Sequence &rhs) +TAO_Unbounded_WString_Sequence & +TAO_Unbounded_WString_Sequence::operator= ( + const TAO_Unbounded_WString_Sequence & rhs + ) { if (this == &rhs) { @@ -408,8 +410,8 @@ operator= (const TAO_Unbounded_WString_Sequence &rhs) if (this->release_) { - CORBA::WChar **tmp = ACE_reinterpret_cast (CORBA::WChar **, - this->buffer_); + CORBA::WChar ** tmp = ACE_reinterpret_cast (CORBA::WChar **, + this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -440,8 +442,8 @@ operator= (const TAO_Unbounded_WString_Sequence &rhs) TAO_Unbounded_Base_Sequence::operator= (rhs); - CORBA::WChar **tmp1 = ACE_reinterpret_cast (CORBA::WChar **, - this->buffer_); + CORBA::WChar ** tmp1 = ACE_reinterpret_cast (CORBA::WChar **, + this->buffer_); CORBA::WChar ** const tmp2 = ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, rhs.buffer_); @@ -458,19 +460,19 @@ TAO_SeqElem_WString_Manager TAO_Unbounded_WString_Sequence::operator[] (CORBA::ULong slot) const { ACE_ASSERT (slot < this->maximum_); - CORBA::WChar **const tmp = + CORBA::WChar ** const tmp = ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, this->buffer_); return TAO_SeqElem_WString_Manager (tmp + slot, this->release_); } -CORBA::WChar* * +CORBA::WChar ** TAO_Unbounded_WString_Sequence::allocbuf (CORBA::ULong nelems) { - CORBA::WChar **buf; + CORBA::WChar ** buf = 0; ACE_NEW_RETURN (buf, - CORBA::WChar *[nelems], + CORBA::WChar * [nelems], 0); for (CORBA::ULong i=0; i < nelems; ++i) @@ -482,7 +484,7 @@ TAO_Unbounded_WString_Sequence::allocbuf (CORBA::ULong nelems) } void -TAO_Unbounded_WString_Sequence::freebuf (CORBA::WChar* *buffer) +TAO_Unbounded_WString_Sequence::freebuf (CORBA::WChar ** buffer) { if (buffer == 0) { @@ -515,10 +517,10 @@ TAO_Unbounded_WString_Sequence::_tao_any_destructor ( delete tmp; } -CORBA::WChar** +CORBA::WChar ** TAO_Unbounded_WString_Sequence::get_buffer (CORBA::Boolean orphan) { - CORBA::WChar* *result = 0; + CORBA::WChar ** result = 0; if (orphan == 0) { @@ -527,11 +529,11 @@ TAO_Unbounded_WString_Sequence::get_buffer (CORBA::Boolean orphan) { result = allocbuf (this->length_); this->buffer_ = result; - this->release_ = 1; + this->release_ = 1; } else { - result = ACE_reinterpret_cast (CORBA::WChar**, + result = ACE_reinterpret_cast (CORBA::WChar **, this->buffer_); } } @@ -541,7 +543,7 @@ TAO_Unbounded_WString_Sequence::get_buffer (CORBA::Boolean orphan) { // We set the state back to default and relinquish // ownership. - result = ACE_reinterpret_cast (CORBA::WChar**, + result = ACE_reinterpret_cast (CORBA::WChar **, this->buffer_); this->maximum_ = 0; this->length_ = 0; @@ -553,10 +555,10 @@ TAO_Unbounded_WString_Sequence::get_buffer (CORBA::Boolean orphan) return result; } -const CORBA::WChar** +const CORBA::WChar ** TAO_Unbounded_WString_Sequence::get_buffer (void) const { - return ACE_reinterpret_cast (const CORBA::WChar** ACE_CAST_CONST, + return ACE_reinterpret_cast (const CORBA::WChar ** ACE_CAST_CONST, this->buffer_); } @@ -568,7 +570,7 @@ TAO_Unbounded_WString_Sequence::_allocate_buffer (CORBA::ULong length) if (this->buffer_ != 0) { CORBA::WChar ** old = ACE_reinterpret_cast (CORBA::WChar **, - this->buffer_); + this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -621,8 +623,8 @@ void TAO_Unbounded_WString_Sequence::_shrink_buffer (CORBA::ULong nl, CORBA::ULong ol) { - CORBA::WChar **tmp = ACE_reinterpret_cast (CORBA::WChar **, - this->buffer_); + CORBA::WChar ** tmp = ACE_reinterpret_cast (CORBA::WChar **, + this->buffer_); for (CORBA::ULong i = nl; i < ol; ++i) { CORBA::wstring_free (tmp[i]); @@ -668,7 +670,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence ( { if (rhs.buffer_ != 0) { - CORBA::Octet *tmp1 = + CORBA::Octet * tmp1 = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->maximum_); @@ -710,7 +712,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence ( TAO_Unbounded_Sequence<CORBA::Octet> & TAO_Unbounded_Sequence<CORBA::Octet>::operator= ( - const TAO_Unbounded_Sequence<CORBA::Octet> &rhs + const TAO_Unbounded_Sequence<CORBA::Octet> & rhs ) { if (this == &rhs) @@ -733,8 +735,8 @@ TAO_Unbounded_Sequence<CORBA::Octet>::operator= ( if (this->maximum_ < rhs.length_) { // free the old buffer - CORBA::Octet *tmp = ACE_reinterpret_cast (CORBA::Octet *, - this->buffer_); + CORBA::Octet * tmp = ACE_reinterpret_cast (CORBA::Octet *, + this->buffer_); TAO_Unbounded_Sequence<CORBA::Octet>::freebuf (tmp); this->buffer_ = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (rhs.length_); @@ -755,7 +757,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::operator= ( TAO_Unbounded_Base_Sequence::operator= (rhs); - CORBA::Octet *tmp1 = ACE_reinterpret_cast (CORBA::Octet *, this->buffer_); + CORBA::Octet * tmp1 = ACE_reinterpret_cast (CORBA::Octet *, this->buffer_); CORBA::Octet * const tmp2 = ACE_reinterpret_cast (CORBA::Octet * ACE_CAST_CONST, rhs.buffer_); @@ -791,7 +793,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::operator= ( #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence ( CORBA::ULong length, - const ACE_Message_Block *mb + const ACE_Message_Block * mb ) : TAO_Unbounded_Base_Sequence (length, length, @@ -841,10 +843,10 @@ TAO_Unbounded_Sequence<CORBA::Octet>::~TAO_Unbounded_Sequence (void) } void -TAO_Unbounded_Sequence<CORBA::Octet>::_tao_any_destructor (void *x) +TAO_Unbounded_Sequence<CORBA::Octet>::_tao_any_destructor (void * x) { - TAO_Unbounded_Sequence<CORBA::Octet> *tmp = - ACE_static_cast (TAO_Unbounded_Sequence<CORBA::Octet>*, + TAO_Unbounded_Sequence<CORBA::Octet> * tmp = + ACE_static_cast (TAO_Unbounded_Sequence<CORBA::Octet> *, x); delete tmp; } @@ -856,8 +858,8 @@ TAO_Unbounded_Sequence<CORBA::Octet>::_allocate_buffer (CORBA::ULong length) if (this->buffer_ != 0) { - CORBA::Octet *old = ACE_reinterpret_cast (CORBA::Octet *, - this->buffer_); + CORBA::Octet * old = ACE_reinterpret_cast (CORBA::Octet *, + this->buffer_); for (CORBA::ULong i = 0; i < this->length_; ++i) { @@ -889,7 +891,7 @@ void TAO_Unbounded_Sequence<CORBA::Octet>::_deallocate_buffer (void) #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ && this->release_ != 0) { - CORBA::Octet *tmp = ACE_reinterpret_cast (CORBA::Octet *, this->buffer_); + CORBA::Octet * tmp = ACE_reinterpret_cast (CORBA::Octet *, this->buffer_); TAO_Unbounded_Sequence<CORBA::Octet>::freebuf (tmp); } #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) @@ -906,8 +908,8 @@ void TAO_Unbounded_Sequence<CORBA::Octet>::_deallocate_buffer (void) // **************************************************************** int -operator== (const TAO_Unbounded_Sequence<CORBA::Octet> &lhs, - const TAO_Unbounded_Sequence<CORBA::Octet> &rhs) +operator== (const TAO_Unbounded_Sequence<CORBA::Octet> & lhs, + const TAO_Unbounded_Sequence<CORBA::Octet> & rhs) { if (rhs.length () != lhs.length ()) { @@ -926,8 +928,8 @@ operator== (const TAO_Unbounded_Sequence<CORBA::Octet> &lhs, } int -operator!= (const TAO_Unbounded_Sequence<CORBA::Octet> &lhs, - const TAO_Unbounded_Sequence<CORBA::Octet> &rhs) +operator!= (const TAO_Unbounded_Sequence<CORBA::Octet> & lhs, + const TAO_Unbounded_Sequence<CORBA::Octet> & rhs) { return !(lhs == rhs); } diff --git a/TAO/tao/Sequence.i b/TAO/tao/Sequence.i index 9ab782198aa..5bb59f9bb63 100644 --- a/TAO/tao/Sequence.i +++ b/TAO/tao/Sequence.i @@ -15,7 +15,7 @@ TAO_Base_Sequence::TAO_Base_Sequence (void) ACE_INLINE TAO_Base_Sequence::TAO_Base_Sequence (CORBA::ULong maximum, CORBA::ULong length, - void *buffer, + void * buffer, CORBA::Boolean release) : maximum_ (maximum), length_ (length), @@ -26,7 +26,7 @@ TAO_Base_Sequence::TAO_Base_Sequence (CORBA::ULong maximum, ACE_INLINE TAO_Base_Sequence::TAO_Base_Sequence (CORBA::ULong maximum, - void *data) + void * data) : maximum_ (maximum), length_ (0), buffer_ (data), @@ -35,7 +35,7 @@ TAO_Base_Sequence::TAO_Base_Sequence (CORBA::ULong maximum, } ACE_INLINE -TAO_Base_Sequence::TAO_Base_Sequence (const TAO_Base_Sequence &rhs) +TAO_Base_Sequence::TAO_Base_Sequence (const TAO_Base_Sequence & rhs) : maximum_ (rhs.maximum_), length_ (rhs.length_), buffer_ (0), @@ -43,14 +43,16 @@ TAO_Base_Sequence::TAO_Base_Sequence (const TAO_Base_Sequence &rhs) { } -ACE_INLINE CORBA::Boolean +ACE_INLINE +CORBA::Boolean TAO_Base_Sequence::release (void) const { return this->release_; } -ACE_INLINE TAO_Base_Sequence & -TAO_Base_Sequence::operator= (const TAO_Base_Sequence &rhs) +ACE_INLINE +TAO_Base_Sequence & +TAO_Base_Sequence::operator= (const TAO_Base_Sequence & rhs) { this->maximum_ = rhs.maximum_; this->length_ = rhs.length_; @@ -58,7 +60,8 @@ TAO_Base_Sequence::operator= (const TAO_Base_Sequence &rhs) return *this; } -ACE_INLINE CORBA::ULong +ACE_INLINE +CORBA::ULong TAO_Base_Sequence::maximum (void) const { return this->maximum_; @@ -72,30 +75,34 @@ TAO_Unbounded_Base_Sequence::TAO_Unbounded_Base_Sequence (void) } ACE_INLINE -TAO_Unbounded_Base_Sequence:: -TAO_Unbounded_Base_Sequence (CORBA::ULong maximum, - CORBA::ULong length, - void* buffer, - CORBA::Boolean release) +TAO_Unbounded_Base_Sequence::TAO_Unbounded_Base_Sequence ( + CORBA::ULong maximum, + CORBA::ULong length, + void * buffer, + CORBA::Boolean release + ) : TAO_Base_Sequence (maximum, length, buffer, release) { } ACE_INLINE -TAO_Unbounded_Base_Sequence:: -TAO_Unbounded_Base_Sequence (CORBA::ULong maximum, - void* buffer) +TAO_Unbounded_Base_Sequence::TAO_Unbounded_Base_Sequence ( + CORBA::ULong maximum, + void * buffer + ) : TAO_Base_Sequence (maximum, buffer) { } -ACE_INLINE CORBA::ULong +ACE_INLINE +CORBA::ULong TAO_Unbounded_Base_Sequence::length (void) const { return this->length_; } -ACE_INLINE void +ACE_INLINE +void TAO_Unbounded_Base_Sequence::length (CORBA::ULong length) { if (length > this->maximum_) @@ -108,6 +115,7 @@ TAO_Unbounded_Base_Sequence::length (CORBA::ULong length) { this->_shrink_buffer (length, this->length_); } + this->length_ = length; } @@ -119,30 +127,34 @@ TAO_Bounded_Base_Sequence::TAO_Bounded_Base_Sequence (void) } ACE_INLINE -TAO_Bounded_Base_Sequence:: -TAO_Bounded_Base_Sequence (CORBA::ULong maximum, - CORBA::ULong length, - void* buffer, - CORBA::Boolean release) +TAO_Bounded_Base_Sequence::TAO_Bounded_Base_Sequence ( + CORBA::ULong maximum, + CORBA::ULong length, + void * buffer, + CORBA::Boolean release + ) : TAO_Base_Sequence (maximum, length, buffer, release) { } ACE_INLINE -TAO_Bounded_Base_Sequence:: -TAO_Bounded_Base_Sequence (CORBA::ULong maximum, - void* buffer) +TAO_Bounded_Base_Sequence::TAO_Bounded_Base_Sequence ( + CORBA::ULong maximum, + void * buffer + ) : TAO_Base_Sequence (maximum, buffer) { } -ACE_INLINE CORBA::ULong +ACE_INLINE +CORBA::ULong TAO_Bounded_Base_Sequence::length (void) const { return this->length_; } -ACE_INLINE void +ACE_INLINE +void TAO_Bounded_Base_Sequence::length (CORBA::ULong length) { if (this->buffer_ == 0) @@ -165,18 +177,18 @@ TAO_Bounded_Base_Sequence::length (CORBA::ULong length) // **************************************************************** -//default constructors ACE_INLINE TAO_Unbounded_String_Sequence::TAO_Unbounded_String_Sequence (void) { } ACE_INLINE -TAO_Unbounded_String_Sequence:: -TAO_Unbounded_String_Sequence (CORBA::ULong maximum, - CORBA::ULong length, - char* *value, - CORBA::Boolean release) +TAO_Unbounded_String_Sequence::TAO_Unbounded_String_Sequence ( + CORBA::ULong maximum, + CORBA::ULong length, + char ** value, + CORBA::Boolean release + ) : TAO_Unbounded_Base_Sequence (maximum, length, value, release) { } @@ -187,25 +199,28 @@ TAO_Unbounded_WString_Sequence::TAO_Unbounded_WString_Sequence (void) } ACE_INLINE -TAO_Unbounded_WString_Sequence:: -TAO_Unbounded_WString_Sequence (CORBA::ULong maximum, - CORBA::ULong length, - CORBA::WChar* *value, - CORBA::Boolean release) +TAO_Unbounded_WString_Sequence::TAO_Unbounded_WString_Sequence ( + CORBA::ULong maximum, + CORBA::ULong length, + CORBA::WChar ** value, + CORBA::Boolean release + ) : TAO_Unbounded_Base_Sequence (maximum, length, value, release) { } // **************************************************************** -ACE_INLINE CORBA::Octet * +ACE_INLINE +CORBA::Octet * TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (CORBA::ULong size) { return new CORBA::Octet[size]; } -ACE_INLINE void -TAO_Unbounded_Sequence<CORBA::Octet>::freebuf (CORBA::Octet *buffer) +ACE_INLINE +void +TAO_Unbounded_Sequence<CORBA::Octet>::freebuf (CORBA::Octet * buffer) { delete [] buffer; } @@ -219,9 +234,13 @@ TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence (void) } ACE_INLINE -TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence (CORBA::ULong maximum) - : TAO_Unbounded_Base_Sequence (maximum, - TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (maximum)) +TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence ( + CORBA::ULong maximum + ) + : TAO_Unbounded_Base_Sequence ( + maximum, + TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (maximum) + ) #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) , mb_ (0) #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ @@ -229,10 +248,12 @@ TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence (CORBA::ULong maxim } ACE_INLINE -TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence (CORBA::ULong maximum, - CORBA::ULong length, - CORBA::Octet *data, - CORBA::Boolean release) +TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence ( + CORBA::ULong maximum, + CORBA::ULong length, + CORBA::Octet * data, + CORBA::Boolean release + ) : TAO_Unbounded_Base_Sequence (maximum, length, data, release) #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) , mb_ (0) @@ -240,18 +261,22 @@ TAO_Unbounded_Sequence<CORBA::Octet>::TAO_Unbounded_Sequence (CORBA::ULong maxim { } -ACE_INLINE const CORBA::Octet * +ACE_INLINE +const CORBA::Octet * TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (void) const { - return ACE_reinterpret_cast(const CORBA::Octet * ACE_CAST_CONST, this->buffer_); + return ACE_reinterpret_cast (const CORBA::Octet * ACE_CAST_CONST, + this->buffer_); } // This function is a little too big to be inlined, but some compilers // (Sun/CC 4.1?) die if it isn't :-( -ACE_INLINE CORBA::Octet * +ACE_INLINE +CORBA::Octet * TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) { - CORBA::Octet *result = 0; + CORBA::Octet * result = 0; + if (orphan == 0) { // We retain ownership. @@ -259,7 +284,8 @@ TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) if (this->buffer_ == 0) { // The buffer was not allocated, we must allocate it now. - result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); + result = + TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); this->buffer_ = result; this->release_ = 1; } @@ -287,7 +313,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) { // We set the state back to default and relinquish // ownership. - result = ACE_reinterpret_cast(CORBA::Octet*,this->buffer_); + result = ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); this->maximum_ = 0; this->length_ = 0; this->buffer_ = 0; @@ -297,6 +323,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) else { result = ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); + if (this->release_ != 0) { // We set the state back to default and relinquish @@ -315,24 +342,28 @@ TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) return result; } -ACE_INLINE CORBA::Octet & +ACE_INLINE +CORBA::Octet & TAO_Unbounded_Sequence<CORBA::Octet>::operator[] (CORBA::ULong i) { ACE_ASSERT (i < this->maximum_); - CORBA::Octet* tmp = ACE_reinterpret_cast(CORBA::Octet*,this->buffer_); + CORBA::Octet * tmp = ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); return tmp[i]; } -ACE_INLINE const CORBA::Octet & +ACE_INLINE +const CORBA::Octet & TAO_Unbounded_Sequence<CORBA::Octet>::operator[] (CORBA::ULong i) const { ACE_ASSERT (i < this->maximum_); - CORBA::Octet * const tmp = ACE_reinterpret_cast (CORBA::Octet* ACE_CAST_CONST, this->buffer_); + CORBA::Octet * const tmp = + ACE_reinterpret_cast (CORBA::Octet * ACE_CAST_CONST, this->buffer_); return tmp[i]; } #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) -ACE_INLINE ACE_Message_Block* +ACE_INLINE +ACE_Message_Block * TAO_Unbounded_Sequence<CORBA::Octet>::mb (void) const { return this->mb_; @@ -340,7 +371,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::mb (void) const ACE_INLINE void TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong length, - const ACE_Message_Block* mb) + const ACE_Message_Block * mb) { this->_deallocate_buffer (); @@ -365,7 +396,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong length, ACE_CDR::MAX_ALIGNMENT); // Get the base pointer of the incoming message block - char *start = ACE_ptr_align_binary (mb->base (), + char * start = ACE_ptr_align_binary (mb->base (), ACE_CDR::MAX_ALIGNMENT); // Get the read and write displacements in the incoming stream @@ -386,10 +417,11 @@ TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong length, #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ -ACE_INLINE void +ACE_INLINE +void TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong max, CORBA::ULong length, - CORBA::Octet *data, + CORBA::Octet * data, CORBA::Boolean release) { this->maximum_ = max; @@ -405,9 +437,11 @@ TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong max, #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ if (this->buffer_ && this->release_ == 1) { - CORBA::Octet* tmp = ACE_reinterpret_cast(CORBA::Octet*,this->buffer_); + CORBA::Octet * tmp = + ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); TAO_Unbounded_Sequence<CORBA::Octet>::freebuf (tmp); } + this->buffer_ = data; this->release_ = release; } diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index 47133f5f916..175834a9b2d 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -2255,6 +2255,10 @@ SOURCE=.\ObjectReferenceTemplateC.i # End Source File
# Begin Source File
+SOURCE=.\Objref_VarOut_T.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\OctetSeqC.i
# End Source File
# Begin Source File
|