Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Message_Queue_T.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Message_Queue_T.i,v 1.1.1.3 2003/02/21 18:36:32 chad Exp $
00003 
00004 template <ACE_SYNCH_DECL> ACE_INLINE int
00005 ACE_Message_Queue<ACE_SYNCH_USE>::dequeue (ACE_Message_Block *&first_item,
00006                                            ACE_Time_Value *timeout)
00007 {
00008   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue");
00009   return this->dequeue_head (first_item, timeout);
00010 }
00011 
00012 template <ACE_SYNCH_DECL> ACE_INLINE ACE_Notification_Strategy *
00013 ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy (void)
00014 {
00015   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy");
00016 
00017   return this->notification_strategy_;
00018 }
00019 
00020 template <ACE_SYNCH_DECL> ACE_INLINE void
00021 ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy (ACE_Notification_Strategy *s)
00022 {
00023   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy");
00024 
00025   this->notification_strategy_ = s;
00026 }
00027 
00028 // Check if queue is empty (does not hold locks).
00029 
00030 template <ACE_SYNCH_DECL> ACE_INLINE int
00031 ACE_Message_Queue<ACE_SYNCH_USE>::is_empty_i (void)
00032 {
00033   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_empty_i");
00034   return this->tail_ == 0;
00035 }
00036 
00037 // Check if queue is full (does not hold locks).
00038 
00039 template <ACE_SYNCH_DECL> ACE_INLINE int
00040 ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i (void)
00041 {
00042   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i");
00043   return this->cur_bytes_ > this->high_water_mark_;
00044 }
00045 
00046 // Check if queue is empty (holds locks).
00047 
00048 template <ACE_SYNCH_DECL> ACE_INLINE int
00049 ACE_Message_Queue<ACE_SYNCH_USE>::is_empty (void)
00050 {
00051   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_empty");
00052   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
00053 
00054   return this->is_empty_i ();
00055 }
00056 
00057 // Check if queue is full (holds locks).
00058 
00059 template <ACE_SYNCH_DECL> ACE_INLINE int
00060 ACE_Message_Queue<ACE_SYNCH_USE>::is_full (void)
00061 {
00062   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full");
00063   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
00064 
00065   return this->is_full_i ();
00066 }
00067 
00068 template <ACE_SYNCH_DECL> ACE_INLINE size_t
00069 ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark (void)
00070 {
00071   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark");
00072   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
00073 
00074   return this->high_water_mark_;
00075 }
00076 
00077 template <ACE_SYNCH_DECL> ACE_INLINE void
00078 ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark (size_t hwm)
00079 {
00080   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark");
00081   ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_);
00082 
00083   this->high_water_mark_ = hwm;
00084 }
00085 
00086 template <ACE_SYNCH_DECL> ACE_INLINE size_t
00087 ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark (void)
00088 {
00089   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark");
00090   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
00091 
00092   return this->low_water_mark_;
00093 }
00094 
00095 template <ACE_SYNCH_DECL> ACE_INLINE void
00096 ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark (size_t lwm)
00097 {
00098   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark");
00099   ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_);
00100 
00101   this->low_water_mark_ = lwm;
00102 }
00103 
00104 template <ACE_SYNCH_DECL> ACE_INLINE size_t
00105 ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes (void)
00106 {
00107   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes");
00108   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
00109 
00110   return this->cur_bytes_;
00111 }
00112 
00113 template <ACE_SYNCH_DECL> ACE_INLINE size_t
00114 ACE_Message_Queue<ACE_SYNCH_USE>::message_length (void)
00115 {
00116   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_length");
00117   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
00118 
00119   return this->cur_length_;
00120 }
00121 
00122 template <ACE_SYNCH_DECL> ACE_INLINE int
00123 ACE_Message_Queue<ACE_SYNCH_USE>::message_count (void)
00124 {
00125   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_count");
00126   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
00127 
00128   return this->cur_count_;
00129 }
00130 
00131 template <ACE_SYNCH_DECL> ACE_INLINE int
00132 ACE_Message_Queue<ACE_SYNCH_USE>::deactivate ()
00133 {
00134   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate");
00135   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
00136 
00137   return this->deactivate_i (0);   // Not a pulse
00138 }
00139 
00140 template <ACE_SYNCH_DECL> ACE_INLINE int
00141 ACE_Message_Queue<ACE_SYNCH_USE>::activate (void)
00142 {
00143   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::activate");
00144   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
00145 
00146   return this->activate_i ();
00147 }
00148 
00149 template <ACE_SYNCH_DECL> ACE_INLINE int
00150 ACE_Message_Queue<ACE_SYNCH_USE>::pulse ()
00151 {
00152   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::pulse");
00153   ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
00154 
00155   return this->deactivate_i (1);   // Just a pulse
00156 }
00157 
00158 template <ACE_SYNCH_DECL> ACE_INLINE int
00159 ACE_Message_Queue<ACE_SYNCH_USE>::deactivated (void)
00160 {
00161   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivated");
00162 
00163   return this->state_ == ACE_Message_Queue_Base::DEACTIVATED;
00164 }
00165 
00166 template <ACE_SYNCH_DECL> ACE_INLINE int
00167 ACE_Message_Queue<ACE_SYNCH_USE>::state (void)
00168 {
00169   ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::state");
00170 
00171   return this->state_;
00172 }
00173 
00174 #if 0
00175 // The Sun Forte 6 (CC 5.1) compiler is only happy if this is in the
00176 // header file      (j.russell.noseworthy@objectsciences.com)
00177 
00178 template <ACE_SYNCH_DECL> ACE_INLINE ACE_SYNCH_MUTEX_T &
00179 ACE_Message_Queue<ACE_SYNCH_USE>::lock (void)
00180 {
00181   return this->lock_;
00182 }
00183 #endif /* 0 */
00184 
00185 ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Reverse_Iterator)
00186 
00187 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00188 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue (ACE_MESSAGE_TYPE *&first_item,
00189                                                                 ACE_Time_Value *timeout)
00190 {
00191   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue");
00192 
00193   return this->dequeue_head (first_item, timeout);
00194 }
00195 
00196 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE ACE_Notification_Strategy *
00197 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy (void)
00198 {
00199   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy");
00200 
00201   return this->queue_.notification_strategy ();
00202 }
00203 
00204 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE void
00205 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy (ACE_Notification_Strategy *s)
00206 {
00207   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy");
00208 
00209   this->queue_.notification_strategy (s);
00210 }
00211 
00212 // Check if queue is empty (holds locks).
00213 
00214 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00215 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_empty (void)
00216 {
00217   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_empty");
00218 
00219   return this->queue_.is_empty ();
00220 }
00221 
00222 // Check if queue is full (holds locks).
00223 
00224 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00225 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_full (void)
00226 {
00227   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_full");
00228 
00229   return this->queue_.is_full ();
00230 }
00231 
00232 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE size_t
00233 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark (void)
00234 {
00235   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark");
00236 
00237   return this->queue_.high_water_mark ();
00238 }
00239 
00240 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE void
00241 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark (size_t hwm)
00242 {
00243   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark");
00244 
00245   this->queue_.high_water_mark (hwm);
00246 }
00247 
00248 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE size_t
00249 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark (void)
00250 {
00251   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark");
00252 
00253   return this->queue_.low_water_mark ();
00254 }
00255 
00256 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE void
00257 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark (size_t lwm)
00258 {
00259   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark");
00260 
00261   this->queue_.low_water_mark (lwm);
00262 }
00263 
00264 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE size_t
00265 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes (void)
00266 {
00267   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes");
00268 
00269   return this->queue_.message_bytes ();
00270 }
00271 
00272 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE size_t
00273 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length (void)
00274 {
00275   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length");
00276 
00277   return this->queue_.message_length ();
00278 }
00279 
00280 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00281 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_count (void)
00282 {
00283   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_count");
00284 
00285   return this->queue_.message_count ();
00286 }
00287 
00288 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00289 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate (void)
00290 {
00291   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate");
00292 
00293   return this->queue_.deactivate ();
00294 }
00295 
00296 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00297 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::activate (void)
00298 {
00299   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::activate");
00300 
00301   return this->queue_.activate ();
00302 }
00303 
00304 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00305 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::pulse (void)
00306 {
00307   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::pulse");
00308 
00309   return this->queue_.pulse ();
00310 }
00311 
00312 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00313 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivated (void)
00314 {
00315   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivated");
00316 
00317   return this->queue_.deactivated ();
00318 }
00319 
00320 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
00321 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::state (void)
00322 {
00323   ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::state");
00324 
00325   return this->queue_.state ();
00326 }
00327 
00328 #if 0
00329 // The Sun Forte 6 (CC 5.1) compiler is only happy if this is in the
00330 // header file      (j.russell.noseworthy@objectsciences.com)
00331 template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE ACE_SYNCH_MUTEX_T &
00332 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::lock (void)
00333 {
00334   return this->queue_.lock ();
00335 }
00336 #endif /* 0 */

Generated on Mon Jun 16 11:20:26 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002