#include <Service_Repository.h>
Collaboration diagram for ACE_Service_Repository_Iterator:

Public Methods | |
| ACE_Service_Repository_Iterator (ACE_Service_Repository &sr, int ignored_suspended=1) | |
| Constructor initializes the iterator. More... | |
| ~ACE_Service_Repository_Iterator (void) | |
| Destructor. More... | |
| int | next (const ACE_Service_Type *&next_item) |
| Pass back the <next_item> that hasn't been seen in the repository. Returns 0 when all items have been seen, else 1. More... | |
| int | done (void) const |
| Returns 1 when all items have been seen, else 0. More... | |
| int | advance (void) |
| Move forward by one element in the repository. Returns 0 when all the items in the set have been seen, else 1. More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
Private Attributes | |
| ACE_Service_Repository & | svc_rep_ |
| Reference to the Service Repository we are iterating over. More... | |
| int | next_ |
| Next index location that we haven't yet seen. More... | |
| int | ignore_suspended_ |
| Are we ignoring suspended services? More... | |
Make sure not to delete entries as the iteration is going on since this class is not designed as a robust iterator.
Definition at line 157 of file Service_Repository.h.
|
||||||||||||
|
Constructor initializes the iterator.
Definition at line 366 of file Service_Repository.cpp.
00368 : svc_rep_ (sr), 00369 next_ (-1), 00370 ignore_suspended_ (ignr_suspended) 00371 { 00372 this->advance (); 00373 } |
|
|
Destructor.
Definition at line 29 of file Service_Repository.i.
00030 {
00031 }
|
|
|
Move forward by one element in the repository. Returns 0 when all the items in the set have been seen, else 1.
Definition at line 405 of file Service_Repository.cpp. References ACE_TRACE, ACE_Service_Repository::current_size_, ignore_suspended_, next_, ACE_Service_Repository::service_vector_, and svc_rep_. Referenced by ACE_Service_Manager::list_services.
00406 {
00407 ACE_TRACE ("ACE_Service_Repository_Iterator::advance");
00408
00409 for (++this->next_;
00410 this->next_ < this->svc_rep_.current_size_
00411 && this->ignore_suspended_
00412 && this->svc_rep_.service_vector_[this->next_]->active () == 0;
00413 this->next_++)
00414 continue;
00415
00416 return this->next_ < this->svc_rep_.current_size_;
00417 }
|
|
|
Returns 1 when all items have been seen, else 0.
Definition at line 392 of file Service_Repository.cpp. References ACE_TRACE, ACE_Service_Repository::current_size_, next_, and svc_rep_.
00393 {
00394 ACE_TRACE ("ACE_Service_Repository_Iterator::done");
00395
00396 return this->next_ >= this->svc_rep_.current_size_;
00397 }
|
|
|
Dump the state of an object.
Definition at line 356 of file Service_Repository.cpp. References ACE_TRACE.
00357 {
00358 ACE_TRACE ("ACE_Service_Repository_Iterator::dump");
00359 }
|
|
|
Pass back the <next_item> that hasn't been seen in the repository. Returns 0 when all items have been seen, else 1.
Definition at line 379 of file Service_Repository.cpp. References ACE_TRACE, ACE_Service_Repository::current_size_, next_, ACE_Service_Repository::service_vector_, and svc_rep_. Referenced by ACE_Service_Manager::list_services.
00380 {
00381 ACE_TRACE ("ACE_Service_Repository_Iterator::next");
00382 if (this->next_ < this->svc_rep_.current_size_)
00383 {
00384 sr = this->svc_rep_.service_vector_[this->next_];
00385 return 1;
00386 }
00387 else
00388 return 0;
00389 }
|
|
|
Declare the dynamic allocation hooks.
Definition at line 185 of file Service_Repository.h. |
|
|
Are we ignoring suspended services?
Definition at line 195 of file Service_Repository.h. Referenced by advance. |
|
|
Next index location that we haven't yet seen.
Definition at line 192 of file Service_Repository.h. |
|
|
Reference to the Service Repository we are iterating over.
Definition at line 189 of file Service_Repository.h. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002