Queued_Data.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 //$Id: Queued_Data.inl 79705 2007-09-24 07:45:37Z johnnyw $
00004 
00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 /*static*/
00008 ACE_INLINE void
00009 TAO_Queued_Data::replace_data_block (ACE_Message_Block &mb)
00010 {
00011   size_t const newsize =
00012     ACE_CDR::total_length (&mb, 0) + ACE_CDR::MAX_ALIGNMENT;
00013 
00014   ACE_Data_Block *db =
00015     mb.data_block ()->clone_nocopy ();
00016 
00017   if (db->size (newsize) == -1)
00018     return;
00019 
00020   ACE_Message_Block tmp (db);
00021   ACE_CDR::mb_align (&tmp);
00022 
00023   tmp.copy (mb.rd_ptr (), mb.length());
00024   mb.data_block (tmp.data_block ()->duplicate ());
00025 
00026   mb.rd_ptr (tmp.rd_ptr ());
00027   mb.wr_ptr (tmp.wr_ptr ());
00028 
00029   // Remove the DONT_DELETE flags from mb
00030   mb.clr_self_flags (ACE_Message_Block::DONT_DELETE);
00031 }
00032 
00033 ACE_INLINE
00034 TAO_Queued_Data::TAO_Queued_Data (ACE_Allocator *alloc)
00035   : msg_block_ (0),
00036     missing_data_ (0),
00037     state_ (),
00038     next_ (0),
00039     allocator_ (alloc)
00040 {
00041 }
00042 
00043 ACE_INLINE
00044 TAO_Queued_Data::TAO_Queued_Data (ACE_Message_Block *mb,
00045                                   ACE_Allocator *alloc)
00046   : msg_block_ (mb),
00047     missing_data_ (0),
00048     state_ (),
00049     next_ (0),
00050     allocator_ (alloc)
00051 {
00052 }
00053 
00054 ACE_INLINE
00055 TAO_Queued_Data::TAO_Queued_Data (const TAO_Queued_Data &qd)
00056   : msg_block_ (qd.msg_block_->duplicate ()),
00057     missing_data_ (qd.missing_data_),
00058     state_ (qd.state_),
00059     next_ (0),
00060     allocator_ (qd.allocator_)
00061 {
00062 }
00063 
00064 
00065 ACE_INLINE size_t
00066 TAO_Queued_Data::missing_data (void) const
00067 {
00068   return this->missing_data_;
00069 }
00070 
00071 ACE_INLINE void
00072 TAO_Queued_Data::missing_data (size_t data)
00073 {
00074   this->missing_data_ = data;
00075 }
00076 
00077 ACE_INLINE TAO_GIOP_Message_Version const &
00078 TAO_Queued_Data::giop_version (void) const
00079 {
00080   return this->state_.giop_version ();
00081 }
00082 
00083 ACE_INLINE CORBA::Octet
00084 TAO_Queued_Data::byte_order (void) const
00085 {
00086   return this->state_.byte_order ();
00087 }
00088 
00089 ACE_INLINE CORBA::Octet
00090 TAO_Queued_Data::more_fragments (void) const
00091 {
00092   return this->state_.more_fragments ();
00093 }
00094 
00095 ACE_INLINE GIOP::MsgType
00096 TAO_Queued_Data::msg_type (void) const
00097 {
00098   return this->state_.message_type ();
00099 }
00100 
00101 ACE_INLINE TAO_Queued_Data *
00102 TAO_Queued_Data::next (void) const
00103 {
00104   return this->next_;
00105 }
00106 
00107 ACE_INLINE void
00108 TAO_Queued_Data::next (TAO_Queued_Data* qd)
00109 {
00110   this->next_ = qd;
00111 }
00112 
00113 ACE_INLINE ACE_Message_Block *
00114 TAO_Queued_Data::msg_block (void) const
00115 {
00116   return this->msg_block_;
00117 }
00118 
00119 ACE_INLINE void
00120 TAO_Queued_Data::msg_block (ACE_Message_Block *mb)
00121 {
00122   this->msg_block_ = mb;
00123 }
00124 
00125 ACE_INLINE void
00126 TAO_Queued_Data::state (const TAO_GIOP_Message_State& state)
00127 {
00128   this->state_ = state;
00129 }
00130 
00131 ACE_INLINE const TAO_GIOP_Message_State&
00132 TAO_Queued_Data::state (void) const
00133 {
00134   return this->state_;
00135 }
00136 
00137 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7