Public Member Functions | |
ACE_TLI_Request_Queue (void) | |
ACE_HANDLE | open (ACE_HANDLE fd, int size) |
int | close (void) |
int | enqueue (const char device[], int restart, int rwflag) |
int | dequeue (ACE_TLI_Request *&ptr) |
int | remove (int sequence_number) |
int | is_empty (void) const |
int | is_full (void) const |
ACE_TLI_Request * | alloc (void) |
void | free (ACE_TLI_Request *node) |
void | dump (void) const |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Private Attributes | |
ACE_HANDLE | handle_ |
int | size_ |
int | current_count_ |
ACE_TLI_Request * | base_ |
ACE_TLI_Request * | tail_ |
ACE_TLI_Request * | free_list_ |
|
Definition at line 226 of file TLI_Acceptor.cpp. References ACE_TRACE.
00227 : size_ (0), 00228 current_count_ (0), 00229 base_ (0), 00230 tail_ (0), 00231 free_list_ (0) 00232 { 00233 ACE_TRACE ("ACE_TLI_Request_Queue::ACE_TLI_Request_Queue"); 00234 } |
|
Definition at line 95 of file TLI_Acceptor.cpp. References ACE_TRACE, and ACE_TLI_Request::next_. Referenced by ACE_TLI_Acceptor::accept(), enqueue(), and open().
00096 { 00097 ACE_TRACE ("ACE_TLI_Request_Queue::alloc"); 00098 ACE_TLI_Request *temp = this->free_list_; 00099 this->free_list_ = this->free_list_->next_; 00100 return temp; 00101 } |
|
Definition at line 175 of file TLI_Acceptor.cpp. References ACE_TRACE, ACE_TLI_Request::callp_, ACE_TLI_Request::handle_, and ACE_OS::t_free(). Referenced by ACE_TLI_Acceptor::close().
00176 { 00177 ACE_TRACE ("ACE_TLI_Request_Queue::close"); 00178 int res = 0; 00179 00180 for (int i = 0; i < this->size_; i++) 00181 { 00182 ACE_TLI_Request &item = this->base_[i]; 00183 00184 item.handle_ = ACE_INVALID_HANDLE; 00185 if (ACE_OS::t_free ((char *) item.callp_, 00186 T_CALL) != 0) 00187 res = -1; 00188 } 00189 00190 delete [] this->base_; 00191 this->base_ = 0; 00192 return res; 00193 } |
|
Definition at line 120 of file TLI_Acceptor.cpp. References ACE_TRACE, and ACE_TLI_Request::next_. Referenced by ACE_TLI_Acceptor::accept().
|
|
Definition at line 61 of file TLI_Acceptor.cpp. References ACE_TRACE.
00062 { 00063 #if defined (ACE_HAS_DUMP) 00064 ACE_TRACE ("ACE_TLI_Request_Queue::dump"); 00065 #endif /* ACE_HAS_DUMP */ 00066 } |
|
Definition at line 240 of file TLI_Acceptor.cpp. References ACE_TRACE, alloc(), ACE_TLI_Request::callp_, free(), ACE_TLI_Request::handle_, ACE_TLI_Request::next_, open_new_endpoint(), and ACE_OS::t_listen(). Referenced by ACE_TLI_Acceptor::handle_async_event().
00242 { 00243 ACE_TRACE ("ACE_TLI_Request_Queue::enqueue"); 00244 ACE_TLI_Request *temp = this->alloc (); 00245 ACE_TLI_Request &req = *this->tail_; 00246 int res; 00247 00248 do 00249 res = ACE_OS::t_listen (this->handle_, req.callp_); 00250 while (res == -1 00251 && restart 00252 && t_errno == TSYSERR 00253 && errno == EINTR); 00254 00255 if (res != -1) 00256 { 00257 req.handle_ = open_new_endpoint (this->handle_, 00258 device, 00259 req.callp_, 00260 rwflag); 00261 if (req.handle_ != ACE_INVALID_HANDLE) 00262 { 00263 temp->next_ = this->tail_->next_; 00264 this->tail_->next_ = temp; 00265 this->tail_ = temp; 00266 this->current_count_++; 00267 return 0; 00268 } 00269 } 00270 00271 // Something must have gone wrong, so free up allocated space. 00272 this->free (temp); 00273 return -1; 00274 } |
|
Definition at line 85 of file TLI_Acceptor.cpp. References ACE_TRACE, and ACE_TLI_Request::next_. Referenced by ACE_TLI_Acceptor::accept(), enqueue(), open(), and remove().
00086 { 00087 ACE_TRACE ("ACE_TLI_Request_Queue::free"); 00088 node->next_ = this->free_list_; 00089 this->free_list_ = node; 00090 } |
|
Definition at line 69 of file TLI_Acceptor.cpp. References ACE_TRACE. Referenced by ACE_TLI_Acceptor::accept().
00070 { 00071 ACE_TRACE ("ACE_TLI_Request_Queue::is_empty"); 00072 return this->current_count_ == 0; 00073 } |
|
Definition at line 76 of file TLI_Acceptor.cpp. References ACE_TRACE.
00077 { 00078 ACE_TRACE ("ACE_TLI_Request_Queue::is_full"); 00079 return this->current_count_ + 1 == this->size_; // Add 1 for the dummy. 00080 } |
|
Definition at line 196 of file TLI_Acceptor.cpp. References ACE_NEW_RETURN, ACE_TRACE, alloc(), ACE_TLI_Request::callp_, free(), ACE_TLI_Request::handle_, ACE_TLI_Request::next_, and ACE_OS::t_alloc(). Referenced by ACE_TLI_Acceptor::open().
00197 { 00198 ACE_TRACE ("ACE_TLI_Request_Queue::open"); 00199 this->handle_ = f; 00200 this->size_ = sz + 1; // Add one more for the dummy node. 00201 00202 ACE_NEW_RETURN (this->base_, 00203 ACE_TLI_Request[this->size_], 00204 ACE_INVALID_HANDLE); 00205 00206 // Initialize the ACE_Queue and the free list. 00207 00208 for (int i = 0; i < this->size_; i++) 00209 { 00210 ACE_TLI_Request *item = &this->base_[i]; 00211 this->free (item); 00212 00213 item->handle_ = ACE_INVALID_HANDLE; 00214 item->callp_ = (t_call *) ACE_OS::t_alloc (this->handle_, 00215 T_CALL, 00216 T_ALL); 00217 if (item->callp_ == 0) 00218 return ACE_INVALID_HANDLE; 00219 } 00220 00221 this->tail_ = this->alloc (); 00222 this->tail_->next_ = this->tail_; 00223 return 0; 00224 } |
|
Definition at line 280 of file TLI_Acceptor.cpp. References ACE_TRACE, ACE_TLI_Request::callp_, free(), ACE_TLI_Request::next_, and ACE_OS::t_close(). Referenced by ACE_TLI_Acceptor::handle_async_event().
00281 { 00282 ACE_TRACE ("ACE_TLI_Request_Queue::remove"); 00283 ACE_TLI_Request *prev = this->tail_; 00284 00285 // Put the sequence # in the dummy node to simply the search... 00286 prev->callp_->sequence = sequence_number; 00287 00288 ACE_TLI_Request *temp; 00289 00290 for (temp = this->tail_->next_; 00291 temp->callp_->sequence != sequence_number; 00292 temp = temp->next_) 00293 prev = temp; 00294 00295 if (temp == this->tail_) 00296 // Sequence # was not found, since we're back at the dummy node! 00297 return -1; 00298 else 00299 { 00300 prev->next_ = temp->next_; 00301 ACE_OS::t_close (temp->handle_); 00302 this->current_count_--; 00303 this->free (temp); 00304 return 0; 00305 } 00306 } |
|
Definition at line 46 of file TLI_Acceptor.cpp. |
|
Definition at line 53 of file TLI_Acceptor.cpp. |
|
Definition at line 52 of file TLI_Acceptor.cpp. |
|
Definition at line 55 of file TLI_Acceptor.cpp. |
|
Definition at line 50 of file TLI_Acceptor.cpp. |
|
Definition at line 51 of file TLI_Acceptor.cpp. |
|
Definition at line 54 of file TLI_Acceptor.cpp. |