00001
00002
00003 #include "tao/Queued_Message.h"
00004
00005 ACE_RCSID (tao,
00006 Queued_Message,
00007 "$Id: Queued_Message.cpp 74052 2006-08-15 15:49:02Z mitza $")
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 bool
00106 TAO_Queued_Message::is_expired (const ACE_Time_Value &) const
00107 {
00108 return false;
00109 }
00110
00111 TAO_END_VERSIONED_NAMESPACE_DECL