Queued_Message.cpp

Go to the documentation of this file.
00001 // Queued_Message.cpp,v 1.15 2006/04/19 09:06:37 jwillemsen Exp
00002 
00003 #include "tao/Queued_Message.h"
00004 
00005 ACE_RCSID (tao,
00006            Queued_Message,
00007            "Queued_Message.cpp,v 1.15 2006/04/19 09:06:37 jwillemsen Exp")
00008 
00009 
00010 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00011 
00012 TAO_Queued_Message::TAO_Queued_Message (TAO_ORB_Core *oc,
00013                                         ACE_Allocator *alloc,
00014                                         bool is_heap_allocated)
00015   : allocator_ (alloc)
00016   , is_heap_created_ (is_heap_allocated)
00017   , orb_core_ (oc)
00018   , next_ (0)
00019   , prev_ (0)
00020 {
00021 }
00022 
00023 TAO_Queued_Message::~TAO_Queued_Message (void)
00024 {
00025 }
00026 
00027 TAO_Queued_Message *
00028 TAO_Queued_Message::next (void) const
00029 {
00030   return this->next_;
00031 }
00032 
00033 TAO_Queued_Message *
00034 TAO_Queued_Message::prev (void) const
00035 {
00036   return this->prev_;
00037 }
00038 
00039 void
00040 TAO_Queued_Message::remove_from_list (TAO_Queued_Message *&head,
00041                                       TAO_Queued_Message *&tail)
00042 {
00043   if (this->prev_ != 0)
00044     {
00045       this->prev_->next_ = this->next_;
00046     }
00047   else if(head == this)
00048     {
00049       head = this->next_;
00050     }
00051 
00052   if (this->next_ != 0)
00053     {
00054       this->next_->prev_ = this->prev_;
00055     }
00056   else if(tail == this)
00057     {
00058       tail = this->prev_;
00059     }
00060 
00061   this->next_ = 0;
00062   this->prev_ = 0;
00063 }
00064 
00065 void
00066 TAO_Queued_Message::push_back (TAO_Queued_Message *&head,
00067                                TAO_Queued_Message *&tail)
00068 {
00069   if (tail == 0)
00070     {
00071       tail = this;
00072       head = this;
00073       this->next_ = 0;
00074       this->prev_ = 0;
00075     }
00076   else
00077     {
00078       tail->next_ = this;
00079       this->prev_ = tail;
00080       this->next_ = 0;
00081       tail = this;
00082     }
00083 }
00084 
00085 void
00086 TAO_Queued_Message::push_front (TAO_Queued_Message *&head,
00087                                 TAO_Queued_Message *&tail)
00088 {
00089   if (head == 0)
00090     {
00091       tail = this;
00092       head = this;
00093       this->next_ = 0;
00094       this->prev_ = 0;
00095     }
00096   else
00097     {
00098       head->prev_ = this;
00099       this->next_ = head;
00100       this->prev_ = 0;
00101       head = this;
00102     }
00103 }
00104 
00105 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 11:54:21 2006 for TAO by doxygen 1.3.6