diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-08-02 01:10:45 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-08-02 01:10:45 +0000 |
commit | f7e3c433d8ec5d4094bab679b3a10c9cf784bb39 (patch) | |
tree | 641738b8594aaf31d26253a47e62a04062957a77 | |
parent | 31c080f83f19eb04f0fcd7ac13939fbb12bb5ce4 (diff) | |
download | ATCD-f7e3c433d8ec5d4094bab679b3a10c9cf784bb39.tar.gz |
ChangeLogTag:Fri Aug 1 17:28:01 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 48 | ||||
-rw-r--r-- | TAO/tao/Adapter.cpp | 3 | ||||
-rw-r--r-- | TAO/tao/Adapter.h | 5 | ||||
-rw-r--r-- | TAO/tao/Any_Basic_Impl_T.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Any_Dual_Impl_T.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Any_Impl_T.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Any_SystemException.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Codeset_Manager.h | 2 | ||||
-rw-r--r-- | TAO/tao/Exception.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Fault_Tolerance_Service.h | 1 | ||||
-rw-r--r-- | TAO/tao/LocalObject.h | 1 | ||||
-rw-r--r-- | TAO/tao/Object.h | 3 | ||||
-rw-r--r-- | TAO/tao/PI_ForwardC.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Key_Adapters.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Principal.h | 1 | ||||
-rw-r--r-- | TAO/tao/RTScheduling/Current.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Refcounted_ObjectKey.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Sequence.cpp | 166 | ||||
-rw-r--r-- | TAO/tao/Sequence.h | 14 | ||||
-rw-r--r-- | TAO/tao/Sequence.i | 153 | ||||
-rw-r--r-- | TAO/tao/Sequence_T.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/Sequence_T.i | 20 | ||||
-rw-r--r-- | TAO/tao/Strategies/advanced_resource.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Transport_Cache_Manager.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Typecode.h | 3 |
25 files changed, 271 insertions, 175 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 7b6ebf1b090..96267f42925 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,51 @@ +Fri Aug 1 17:28:01 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * tao/Adapter.h: Forward declared CORBA::Exception. + * tao/Adapter.cpp: #included Exception.h + + * tao/Any_Basic_Impl_T.cpp: + * tao/Any_Dual_Impl_T.cpp: + * tao/Any_Impl_T.cpp: + * tao/Any_SystemException.cpp: #included ace/Auto_Ptr.h + + * tao/Codeset_Manager.h: #included ace/Unbounded_Set.h + + * tao/Exception.cpp: #included ace/Malloc.h + + * tao/LocalObject.h: + * tao/Fault_Tolerance_Service.h: #included ace/Synch.h + + * tao/Object.h: Forward declared ACE_Lock; + + * tao/PI_ForwardC.cpp: #included "Typecode.h" + * tao/Principal.h: #included "Pseudo_VarOut_T.h" + + * tao/Refcounted_ObjectKey.cpp: #included "ace/Log_Msg.h". + + * tao/Sequence_T.cpp: + * tao/Sequence_T.i: + * tao/Sequence.cpp: + * tao/Sequence.h: + * tao/Sequence.i: Removed dependency on Log_Msg.h ie. files + including Sequence.h wouldnt get Log_msg.h free. Log_Msg.h was + included just to get ACE_ASSERT. + + Added a new method check_bounds () which is used for checking + the bounds of the sequence. + + * tao/Typecode.h: #included "ace/Hash_Map_Manager.h" and + "ace/Unbounded_Queue.h". + + * tao/PortableServer/Key_Adapters.cpp: + * tao/RTScheduling/Current.cpp: + * tao/Transport_Cache_Manager.cpp: #included "ace/ACE.h". + + * tao/Strategies/advanced_resource.cpp: #included "ace/Malloc.h". + + Thanks to Carlos for providing the patches. These patches + improve the compilation times by removing unwanted dependencies + that take up compilation time for TAO's applications. + Fri Aug 1 17:04:49 2003 Yamuna Krishnamurthy <yamuna@oomworks.com> * examples/RTScheduling/MIF_Scheduler/MIF_DT_Creator.cpp: diff --git a/TAO/tao/Adapter.cpp b/TAO/tao/Adapter.cpp index e63e9efcc1b..47157969a96 100644 --- a/TAO/tao/Adapter.cpp +++ b/TAO/tao/Adapter.cpp @@ -1,5 +1,6 @@ // $Id$ -#include "tao/Adapter.h" +#include "Adapter.h" +#include "Exception.h" #include "ace/Dynamic_Service.h" #include "debug.h" diff --git a/TAO/tao/Adapter.h b/TAO/tao/Adapter.h index a5f602e8ef5..fd03659d86a 100644 --- a/TAO/tao/Adapter.h +++ b/TAO/tao/Adapter.h @@ -29,6 +29,11 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ +namespace CORBA +{ + class Exception; +}; + class TAO_ORB_Core; class TAO_Stub; class TAO_MProfile; diff --git a/TAO/tao/Any_Basic_Impl_T.cpp b/TAO/tao/Any_Basic_Impl_T.cpp index 88c55a7e04b..aa63987afa4 100644 --- a/TAO/tao/Any_Basic_Impl_T.cpp +++ b/TAO/tao/Any_Basic_Impl_T.cpp @@ -7,6 +7,7 @@ #include "tao/Marshal.h" #include "tao/debug.h" #include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" #if !defined (__ACE_INLINE__) # include "tao/Any_Basic_Impl_T.inl" diff --git a/TAO/tao/Any_Dual_Impl_T.cpp b/TAO/tao/Any_Dual_Impl_T.cpp index 374308fe3de..9da1f74ec1e 100644 --- a/TAO/tao/Any_Dual_Impl_T.cpp +++ b/TAO/tao/Any_Dual_Impl_T.cpp @@ -9,6 +9,7 @@ #include "tao/CORBA_String.h" #include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" #if !defined (__ACE_INLINE__) # include "tao/Any_Dual_Impl_T.inl" diff --git a/TAO/tao/Any_Impl_T.cpp b/TAO/tao/Any_Impl_T.cpp index 28abc307b4b..c910b3f9b65 100644 --- a/TAO/tao/Any_Impl_T.cpp +++ b/TAO/tao/Any_Impl_T.cpp @@ -7,6 +7,7 @@ #include "tao/Marshal.h" #include "tao/debug.h" #include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" #if !defined (__ACE_INLINE__) # include "tao/Any_Impl_T.inl" diff --git a/TAO/tao/Any_SystemException.cpp b/TAO/tao/Any_SystemException.cpp index c1125558c1f..b6e79ec0807 100644 --- a/TAO/tao/Any_SystemException.cpp +++ b/TAO/tao/Any_SystemException.cpp @@ -8,6 +8,7 @@ #include "Marshal.h" #include "debug.h" #include "CORBA_String.h" +#include "ace/Auto_Ptr.h" #include "ace/CORBA_macros.h" diff --git a/TAO/tao/Codeset_Manager.h b/TAO/tao/Codeset_Manager.h index a290611be24..43aa23471bf 100644 --- a/TAO/tao/Codeset_Manager.h +++ b/TAO/tao/Codeset_Manager.h @@ -22,6 +22,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Unbounded_Set.h" + class TAO_Profile; class TAO_Transport; class TAO_Operation_Details; diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp index 94ee1cbdd66..3176633f26c 100644 --- a/TAO/tao/Exception.cpp +++ b/TAO/tao/Exception.cpp @@ -12,6 +12,7 @@ #include "ORB_Core.h" #include "Any_SystemException.h" +#include "ace/Malloc.h" #include "ace/streams.h" diff --git a/TAO/tao/Fault_Tolerance_Service.h b/TAO/tao/Fault_Tolerance_Service.h index 2e53ef9f8af..a25c898276a 100644 --- a/TAO/tao/Fault_Tolerance_Service.h +++ b/TAO/tao/Fault_Tolerance_Service.h @@ -26,6 +26,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/corbafwd.h" +#include "ace/Synch.h" class TAO_Service_Callbacks; diff --git a/TAO/tao/LocalObject.h b/TAO/tao/LocalObject.h index 724a77620b4..405368daf4e 100644 --- a/TAO/tao/LocalObject.h +++ b/TAO/tao/LocalObject.h @@ -29,6 +29,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "Object_KeyC.h" +#include "ace/Synch.h" namespace CORBA { diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h index bc7b5fe7c20..e7151ce50dc 100644 --- a/TAO/tao/Object.h +++ b/TAO/tao/Object.h @@ -29,7 +29,8 @@ #include "tao/Object_KeyC.h" #include "tao/Pseudo_VarOut_T.h" -#include "ace/Synch.h" +//#include "ace/Synch.h" +class ACE_Lock; #include "tao/IOP_IORC.h" diff --git a/TAO/tao/PI_ForwardC.cpp b/TAO/tao/PI_ForwardC.cpp index 929808c426f..f1795a33761 100644 --- a/TAO/tao/PI_ForwardC.cpp +++ b/TAO/tao/PI_ForwardC.cpp @@ -30,6 +30,7 @@ #include "PI_ForwardC.h" +#include "tao/Typecode.h" #if defined (__BORLANDC__) #pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig diff --git a/TAO/tao/PortableServer/Key_Adapters.cpp b/TAO/tao/PortableServer/Key_Adapters.cpp index 1cae96bc389..58410c173a2 100644 --- a/TAO/tao/PortableServer/Key_Adapters.cpp +++ b/TAO/tao/PortableServer/Key_Adapters.cpp @@ -1,6 +1,7 @@ // $Id$ #include "Key_Adapters.h" +#include "ace/ACE.h" #if !defined (__ACE_INLINE__) # include "Key_Adapters.i" diff --git a/TAO/tao/Principal.h b/TAO/tao/Principal.h index 0201f225749..19e47ed3250 100644 --- a/TAO/tao/Principal.h +++ b/TAO/tao/Principal.h @@ -26,6 +26,7 @@ #include "OctetSeqC.h" #include "ace/Synch_T.h" +#include "Pseudo_VarOut_T.h" namespace CORBA { diff --git a/TAO/tao/RTScheduling/Current.cpp b/TAO/tao/RTScheduling/Current.cpp index 711b6635036..fe1402b105f 100644 --- a/TAO/tao/RTScheduling/Current.cpp +++ b/TAO/tao/RTScheduling/Current.cpp @@ -4,6 +4,7 @@ #include "Distributable_Thread.h" #include "tao/RTCORBA/Priority_Mapping_Manager.h" #include "tao/RTCORBA/RT_Current.h" +#include "ace/ACE.h" //#include "ThreadAction.h" diff --git a/TAO/tao/Refcounted_ObjectKey.cpp b/TAO/tao/Refcounted_ObjectKey.cpp index 6fdb9a4bb5f..960bb12de69 100644 --- a/TAO/tao/Refcounted_ObjectKey.cpp +++ b/TAO/tao/Refcounted_ObjectKey.cpp @@ -1,6 +1,6 @@ //$Id$ #include "Refcounted_ObjectKey.h" - +#include "ace/Log_Msg.h" #if !defined (__ACE_INLINE__) #include "Refcounted_ObjectKey.inl" diff --git a/TAO/tao/Sequence.cpp b/TAO/tao/Sequence.cpp index f17948d7ddd..627389a25f2 100644 --- a/TAO/tao/Sequence.cpp +++ b/TAO/tao/Sequence.cpp @@ -1,6 +1,8 @@ // $Id$ #include "tao/Sequence.h" +#include "ace/Message_Block.h" +#include "ace/Log_Msg.h" #if !defined (__ACE_INLINE__) #include "tao/Sequence.i" @@ -38,6 +40,21 @@ TAO_Base_Sequence::_upcast (void *) const return 0; } +void TAO_Base_Sequence:: +check_bounds( + char const * filename, unsigned long lineno, + CORBA::ULong tao_idx, CORBA::ULong tao_max) const +{ + // TODO use hook + if(tao_idx >= tao_max) + { + ACE_ERROR((LM_ERROR, + "Access error in TAO_Sequence file=%s, line=%u, " + "idx=%u, max=%u\n", + filename, lineno, tao_idx, tao_max)); + } +} + // ************************************************************* // Operations for class TAO_Unbounded_Base_Sequence // ************************************************************* @@ -842,6 +859,126 @@ TAO_Unbounded_Sequence<CORBA::Octet>::~TAO_Unbounded_Sequence (void) this->_deallocate_buffer (); } +// This function is a little too big to be inlined, but some compilers +// (Sun/CC 4.1?) die if it isn't :-( +CORBA::Octet * +TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) +{ + CORBA::Octet * result = 0; + + if (orphan == 0) + { + // We retain ownership. + + if (this->buffer_ == 0) + { + // The buffer was not allocated, we must allocate it now. + result = + TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); + this->buffer_ = result; + this->release_ = 1; + } + else + { + result = + ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); + } + } +#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) + else if (this->mb_ != 0) // (orphan == 1) + { + // We must create a copy anyway: + // the user is supposed to call freebuf() to release the + // buffer, but the buffer is inside a Message_Block... + // We thought about storing the pointer to the Message_Block + // somewhere at the beginning of the buffer (before the actual + // data), but that will not work in 64 bit machines when the + // buffer comes from a CDR stream. + // + result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); + ACE_OS::memcpy (result, this->buffer_, this->length_); + } + else if (this->release_ != 0) + { + // We set the state back to default and relinquish + // ownership. + result = ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); + this->maximum_ = 0; + this->length_ = 0; + this->buffer_ = 0; + this->release_ = 0; + } +#else /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ + else + { + result = ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); + + if (this->release_ != 0) + { + // We set the state back to default and relinquish + // ownership. + this->maximum_ = 0; + this->length_ = 0; + this->buffer_ = 0; + this->release_ = 0; + } + } +#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ + /* else + // Oops, it's not our buffer to relinquish... + return 0; + */ + return result; +} + +#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) +ACE_INLINE void +TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong length, + const ACE_Message_Block * mb) +{ + this->_deallocate_buffer (); + + // Get the message block flags. + ACE_Message_Block::Message_Flags flg = mb->self_flags (); + + // If the DONT_DELETE flag is disabled just a duplicate would + // help. If the DONT_DELETE flag is enabled a deep copy is needed as + // the contents would be on stack. Just incrementing the ref count + // on the stack based data block would only crash the program when + // the stack unwinds + if (ACE_BIT_DISABLED (flg, + ACE_Message_Block::DONT_DELETE)) + { + this->mb_ = ACE_Message_Block::duplicate (mb); + } + else + { + // As we are in CORBA mode, all the data blocks would be aligned + // on an 8 byte boundary + ACE_Message_Block msgb (*mb, + ACE_CDR::MAX_ALIGNMENT); + + // Get the base pointer of the incoming message block + char * start = ACE_ptr_align_binary (mb->base (), + ACE_CDR::MAX_ALIGNMENT); + + // Get the read and write displacements in the incoming stream + size_t rd_pos = mb->rd_ptr () - start; + size_t wr_pos = mb->wr_ptr () - start; + + this->mb_ = ACE_Message_Block::duplicate (&msgb); + + this->mb_->rd_ptr (rd_pos); + this->mb_->wr_ptr (wr_pos); + } + + this->buffer_ = this->mb_->rd_ptr (); + this->maximum_ = length; + this->length_ = length; + this->release_ = 0; +} +#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ + void TAO_Unbounded_Sequence<CORBA::Octet>::_tao_any_destructor (void * x) { @@ -905,6 +1042,35 @@ void TAO_Unbounded_Sequence<CORBA::Octet>::_deallocate_buffer (void) this->buffer_ = 0; } +ACE_INLINE +void +TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong max, + CORBA::ULong length, + CORBA::Octet * data, + CORBA::Boolean release) +{ + this->maximum_ = max; + this->length_ = length; + +#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) + if (this->mb_ != 0) + { + ACE_Message_Block::release (this->mb_); + this->mb_ = 0; + } + else +#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ + if (this->buffer_ && this->release_ == 1) + { + CORBA::Octet * tmp = + ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); + TAO_Unbounded_Sequence<CORBA::Octet>::freebuf (tmp); + } + + this->buffer_ = data; + this->release_ = release; +} + // **************************************************************** int diff --git a/TAO/tao/Sequence.h b/TAO/tao/Sequence.h index edee97fa947..33bae9bf519 100644 --- a/TAO/tao/Sequence.h +++ b/TAO/tao/Sequence.h @@ -25,9 +25,8 @@ #include "tao/Managed_Types.h" #include "ace/CORBA_macros.h" -#include "ace/Log_Msg.h" /* For "ACE_ASSERT" */ -#include "ace/Message_Block.h" +class ACE_Message_Block; /** * @class TAO_Base_Sequence @@ -100,6 +99,10 @@ protected: TAO_Base_Sequence (CORBA::ULong maximum, void *buffer); + void check_bounds( + char const * filename, unsigned long lineno, + CORBA::ULong tao_idx, CORBA::ULong tao_max) const; + public: // = The following two functions should be protected but we made it @@ -650,6 +653,13 @@ TAO_Export int operator!= (const TAO_Unbounded_Sequence<CORBA::Octet> &l, // **************************************************************** +/** + * @brief Safe assertions without including Log_Msg.h + */ +#define TAO_SEQUENCE_ASSERT(TAO_IDX,TAO_MAX) \ + this->check_bounds(__FILE__, __LINE__, (TAO_IDX), (TAO_MAX)) + + #if defined (__ACE_INLINE__) #include "tao/Sequence.i" #endif /* __ACE_INLINE__ */ diff --git a/TAO/tao/Sequence.i b/TAO/tao/Sequence.i index 5bb59f9bb63..002df07f3ed 100644 --- a/TAO/tao/Sequence.i +++ b/TAO/tao/Sequence.i @@ -269,84 +269,11 @@ TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (void) 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 * -TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) -{ - CORBA::Octet * result = 0; - - if (orphan == 0) - { - // We retain ownership. - - if (this->buffer_ == 0) - { - // The buffer was not allocated, we must allocate it now. - result = - TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); - this->buffer_ = result; - this->release_ = 1; - } - else - { - result = - ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); - } - } -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - else if (this->mb_ != 0) // (orphan == 1) - { - // We must create a copy anyway: - // the user is supposed to call freebuf() to release the - // buffer, but the buffer is inside a Message_Block... - // We thought about storing the pointer to the Message_Block - // somewhere at the beginning of the buffer (before the actual - // data), but that will not work in 64 bit machines when the - // buffer comes from a CDR stream. - // - result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); - ACE_OS::memcpy (result, this->buffer_, this->length_); - } - else if (this->release_ != 0) - { - // We set the state back to default and relinquish - // ownership. - result = ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); - this->maximum_ = 0; - this->length_ = 0; - this->buffer_ = 0; - this->release_ = 0; - } -#else /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ - else - { - result = ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); - - if (this->release_ != 0) - { - // We set the state back to default and relinquish - // ownership. - this->maximum_ = 0; - this->length_ = 0; - this->buffer_ = 0; - this->release_ = 0; - } - } -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ - /* else - // Oops, it's not our buffer to relinquish... - return 0; - */ - return result; -} - ACE_INLINE CORBA::Octet & TAO_Unbounded_Sequence<CORBA::Octet>::operator[] (CORBA::ULong i) { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); CORBA::Octet * tmp = ACE_reinterpret_cast(CORBA::Octet *, this->buffer_); return tmp[i]; } @@ -355,7 +282,7 @@ ACE_INLINE const CORBA::Octet & TAO_Unbounded_Sequence<CORBA::Octet>::operator[] (CORBA::ULong i) const { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); CORBA::Octet * const tmp = ACE_reinterpret_cast (CORBA::Octet * ACE_CAST_CONST, this->buffer_); return tmp[i]; @@ -368,80 +295,4 @@ TAO_Unbounded_Sequence<CORBA::Octet>::mb (void) const { return this->mb_; } - -ACE_INLINE void -TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong length, - const ACE_Message_Block * mb) -{ - this->_deallocate_buffer (); - - // Get the message block flags. - ACE_Message_Block::Message_Flags flg = mb->self_flags (); - - // If the DONT_DELETE flag is disabled just a duplicate would - // help. If the DONT_DELETE flag is enabled a deep copy is needed as - // the contents would be on stack. Just incrementing the ref count - // on the stack based data block would only crash the program when - // the stack unwinds - if (ACE_BIT_DISABLED (flg, - ACE_Message_Block::DONT_DELETE)) - { - this->mb_ = ACE_Message_Block::duplicate (mb); - } - else - { - // As we are in CORBA mode, all the data blocks would be aligned - // on an 8 byte boundary - ACE_Message_Block msgb (*mb, - ACE_CDR::MAX_ALIGNMENT); - - // Get the base pointer of the incoming message block - char * start = ACE_ptr_align_binary (mb->base (), - ACE_CDR::MAX_ALIGNMENT); - - // Get the read and write displacements in the incoming stream - size_t rd_pos = mb->rd_ptr () - start; - size_t wr_pos = mb->wr_ptr () - start; - - this->mb_ = ACE_Message_Block::duplicate (&msgb); - - this->mb_->rd_ptr (rd_pos); - this->mb_->wr_ptr (wr_pos); - } - - this->buffer_ = this->mb_->rd_ptr (); - this->maximum_ = length; - this->length_ = length; - this->release_ = 0; -} - #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ - -ACE_INLINE -void -TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong max, - CORBA::ULong length, - CORBA::Octet * data, - CORBA::Boolean release) -{ - this->maximum_ = max; - this->length_ = length; - -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - if (this->mb_ != 0) - { - ACE_Message_Block::release (this->mb_); - this->mb_ = 0; - } - else -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ - if (this->buffer_ && this->release_ == 1) - { - 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/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp index 9a3aa7adc84..9d401f9e61e 100644 --- a/TAO/tao/Sequence_T.cpp +++ b/TAO/tao/Sequence_T.cpp @@ -4,8 +4,6 @@ #define TAO_SEQUENCE_T_C #include "tao/Sequence_T.h" -#include "tao/Typecode.h" -#include "tao/Environment.h" #if !defined (__ACE_INLINE__) #include "tao/Sequence_T.i" @@ -184,7 +182,7 @@ template <typename T> T & TAO_Unbounded_Sequence<T>::operator[] (CORBA::ULong i) { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); T * tmp = ACE_reinterpret_cast (T *, this->buffer_); return tmp[i]; @@ -196,7 +194,7 @@ template <typename T> const T & TAO_Unbounded_Sequence<T>::operator[] (CORBA::ULong i) const { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); T * const tmp = ACE_reinterpret_cast (T * ACE_CAST_CONST, this->buffer_); return tmp[i]; @@ -1978,7 +1976,7 @@ template<size_t MAX> TAO_SeqElem_String_Manager TAO_Bounded_String_Sequence<MAX>::operator[] (CORBA::ULong slot) const { - ACE_ASSERT (slot < this->maximum_); + TAO_SEQUENCE_ASSERT (slot, this->maximum_); char ** const tmp = ACE_reinterpret_cast (char ** ACE_CAST_CONST, this->buffer_); return TAO_SeqElem_String_Manager (tmp + slot, @@ -2068,7 +2066,7 @@ TAO_Bounded_String_Sequence<MAX>::replace (CORBA::ULong length, char ** data, CORBA::Boolean release) { - ACE_ASSERT (length < this->maximum_); + TAO_SEQUENCE_ASSERT (length, this->maximum_); this->_deallocate_buffer (); this->length_ = length; @@ -2175,7 +2173,7 @@ template<size_t MAX> TAO_SeqElem_WString_Manager TAO_Bounded_WString_Sequence<MAX>::operator[] (CORBA::ULong slot) const { - ACE_ASSERT (slot < this->maximum_); + TAO_SEQUENCE_ASSERT (slot, this->maximum_); CORBA::WChar ** const tmp = ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, this->buffer_); @@ -2268,7 +2266,7 @@ TAO_Bounded_WString_Sequence<MAX>::replace (CORBA::ULong length, CORBA::WChar ** data, CORBA::Boolean release) { - ACE_ASSERT (length < this->maximum_); + TAO_SEQUENCE_ASSERT (length, this->maximum_); this->_deallocate_buffer (); this->length_ = length; diff --git a/TAO/tao/Sequence_T.i b/TAO/tao/Sequence_T.i index 62febe426fb..5ca700f1111 100644 --- a/TAO/tao/Sequence_T.i +++ b/TAO/tao/Sequence_T.i @@ -102,7 +102,7 @@ ACE_INLINE T & TAO_Bounded_Sequence<T, MAX>::operator[] (CORBA::ULong i) { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); T * tmp = ACE_reinterpret_cast (T *,this->buffer_); return tmp[i]; } @@ -112,7 +112,7 @@ ACE_INLINE const T & TAO_Bounded_Sequence<T, MAX>::operator[] (CORBA::ULong i) const { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); const T * tmp = ACE_reinterpret_cast (const T * ACE_CAST_CONST,this->buffer_); return tmp[i]; } @@ -310,7 +310,7 @@ TAO_Unbounded_Object_Sequence<T,T_var,T_life,T_cast>::operator[] ( CORBA::ULong slot ) const { - ACE_ASSERT (slot < this->maximum_); + TAO_SEQUENCE_ASSERT (slot, this->maximum_); T ** const tmp = ACE_reinterpret_cast (T ** ACE_CAST_CONST, this->buffer_); return @@ -358,7 +358,7 @@ TAO_Bounded_Object_Sequence<T, T_var,T_life,T_cast,MAX>::operator[] ( CORBA::ULong slot ) const { - ACE_ASSERT (slot < this->maximum_); + TAO_SEQUENCE_ASSERT (slot, this->maximum_); T ** const tmp = ACE_reinterpret_cast (T ** ACE_CAST_CONST, this->buffer_); return @@ -392,7 +392,7 @@ ACE_INLINE TAO_Pseudo_Object_Manager<T,T_var> TAO_Unbounded_Pseudo_Sequence<T,T_var>::operator[] (CORBA::ULong slot) const { - ACE_ASSERT (slot < this->maximum_); + TAO_SEQUENCE_ASSERT (slot, this->maximum_); T ** const tmp = ACE_reinterpret_cast (T ** ACE_CAST_CONST, this->buffer_); return TAO_Pseudo_Object_Manager<T,T_var> (tmp + slot, this->release_); } @@ -425,7 +425,7 @@ TAO_Bounded_Pseudo_Sequence<T,T_var,MAX>::operator[] ( CORBA::ULong slot ) const { - ACE_ASSERT (slot < this->maximum_); + TAO_SEQUENCE_ASSERT (slot, this->maximum_); T ** const tmp = ACE_reinterpret_cast (T ** ACE_CAST_CONST, this->buffer_); return TAO_Pseudo_Object_Manager<T,T_var> (tmp + slot, @@ -482,7 +482,7 @@ ACE_INLINE T & TAO_Unbounded_Array_Sequence<T,T_var>::operator[] (CORBA::ULong i) { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) return ((T *) this->buffer_)[i]; @@ -496,7 +496,7 @@ ACE_INLINE const T & TAO_Unbounded_Array_Sequence<T,T_var>::operator[] (CORBA::ULong i) const { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) return ((const T * ACE_CAST_CONST) this->buffer_)[i]; @@ -541,7 +541,7 @@ ACE_INLINE T & TAO_Bounded_Array_Sequence<T,T_var,MAX>::operator[] (CORBA::ULong i) { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) return ((T *) this->buffer_)[i]; @@ -555,7 +555,7 @@ ACE_INLINE const T & TAO_Bounded_Array_Sequence<T,T_var,MAX>::operator[] (CORBA::ULong i) const { - ACE_ASSERT (i < this->maximum_); + TAO_SEQUENCE_ASSERT (i, this->maximum_); #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) return ((const T * ACE_CAST_CONST) this->buffer_)[i]; diff --git a/TAO/tao/Strategies/advanced_resource.cpp b/TAO/tao/Strategies/advanced_resource.cpp index 80429c6ae87..06edc5b1701 100644 --- a/TAO/tao/Strategies/advanced_resource.cpp +++ b/TAO/tao/Strategies/advanced_resource.cpp @@ -33,6 +33,7 @@ #include "ace/WFMO_Reactor.h" #include "ace/Msg_WFMO_Reactor.h" #include "ace/TP_Reactor.h" +#include "ace/Malloc.h" ACE_RCSID(Strategies, advanced_resource, "$Id$") diff --git a/TAO/tao/Transport_Cache_Manager.cpp b/TAO/tao/Transport_Cache_Manager.cpp index 0ddbc9a16e2..14486286beb 100644 --- a/TAO/tao/Transport_Cache_Manager.cpp +++ b/TAO/tao/Transport_Cache_Manager.cpp @@ -8,6 +8,7 @@ #include "ace/Synch_T.h" #include "ace/Containers_T.h" #include "ace/Handle_Set.h" +#include "ace/ACE.h" #if !defined (__ACE_INLINE__) # include "tao/Transport_Cache_Manager.inl" diff --git a/TAO/tao/Typecode.h b/TAO/tao/Typecode.h index 0b94236d6a3..6a35e3d1839 100644 --- a/TAO/tao/Typecode.h +++ b/TAO/tao/Typecode.h @@ -19,7 +19,8 @@ #include /**/ "ace/pre.h" -#include "ace/Hash_Map_Manager_T.h" +#include "ace/Hash_Map_Manager.h" +#include "ace/Unbounded_Queue.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once |