ACE_Service_Repository_Iterator Class Reference

Iterate through the ACE_Service_Repository. More...

#include <Service_Repository.h>

Collaboration diagram for ACE_Service_Repository_Iterator:

Collaboration graph
List of all members.

Public Member Functions

 ACE_Service_Repository_Iterator (ACE_Service_Repository &sr, int ignored_suspended=1)
 Constructor initializes the iterator.

 ~ACE_Service_Repository_Iterator (void)

int next (const ACE_Service_Type *&next_item)
int done (void) const
 Returns 1 when all items have been seen, else 0.

int advance (void)
void dump (void) const
 Dump the state of an object.

Public Attributes

 Declare the dynamic allocation hooks.

Private Member Functions

bool valid (void) const
 ACE_Service_Repository_Iterator (const ACE_Service_Repository_Iterator &)

Private Attributes

 Reference to the Service Repository we are iterating over.

size_t next_
 Next index location that we haven't yet seen.

int ignore_suspended_
 Are we ignoring suspended services?

Detailed Description

Iterate through the ACE_Service_Repository.

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 170 of file Service_Repository.h.

Constructor & Destructor Documentation

ACE_Service_Repository_Iterator::ACE_Service_Repository_Iterator ACE_Service_Repository sr,
int  ignored_suspended = 1

Constructor initializes the iterator.

Definition at line 453 of file Service_Repository.cpp.

00454   : svc_rep_ (sr),
00455     next_ (0),
00456     ignore_suspended_ (ignr_suspended)
00457 {
00458   while (!(done() || valid()))
00459     this->next_++;
00460 }

ACE_INLINE ACE_Service_Repository_Iterator::~ACE_Service_Repository_Iterator void   ) 


Definition at line 47 of file Service_Repository.inl.

00048 {
00049 }

ACE_Service_Repository_Iterator::ACE_Service_Repository_Iterator const ACE_Service_Repository_Iterator  )  [private]

Member Function Documentation

int ACE_Service_Repository_Iterator::advance void   ) 

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 483 of file Service_Repository.cpp.

References ACE_TRACE, done(), and valid().

Referenced by ACE_Service_Manager::list_services().

00484 {
00485   ACE_TRACE ("ACE_Service_Repository_Iterator::advance");
00487   if (done()) return 0;
00489   do this->next_++; while (!(done () || valid ()));
00491   return !done();
00492 }

ACE_INLINE int ACE_Service_Repository_Iterator::done void   )  const

Returns 1 when all items have been seen, else 0.

Definition at line 39 of file Service_Repository.inl.

References ACE_TRACE, and ACE_Service_Repository::current_size_.

Referenced by advance(), and next().

00040 {
00041   ACE_TRACE ("ACE_Service_Repository_Iterator::done");
00043   return this->next_ >= this->svc_rep_.current_size_;
00044 }

void ACE_Service_Repository_Iterator::dump void   )  const

Dump the state of an object.

Definition at line 441 of file Service_Repository.cpp.

References ACE_TRACE.

00442 {
00443 #if defined (ACE_HAS_DUMP)
00444   ACE_TRACE ("ACE_Service_Repository_Iterator::dump");
00445 #endif /* ACE_HAS_DUMP */
00446 }

int ACE_Service_Repository_Iterator::next const ACE_Service_Type *&  next_item  ) 

Pass back the that hasn't been seen in the repository. Returns 0 when all items have been seen, else 1.

Definition at line 466 of file Service_Repository.cpp.

References ACE_TRACE, done(), and ACE_Service_Repository::service_vector_.

Referenced by ACE_Service_Manager::list_services().

00467 {
00468   ACE_TRACE ("ACE_Service_Repository_Iterator::next");
00470   if (done ())
00471     return 0;
00473   sr = this->svc_rep_.service_vector_[this->next_];
00474   return 1;
00475 }

bool ACE_Service_Repository_Iterator::valid void   )  const [private]

Definition at line 495 of file Service_Repository.cpp.

References ACE_TRACE, ACE_Service_Type::active(), ignore_suspended_, and ACE_Service_Repository::service_vector_.

Referenced by advance().

00496 {
00497   ACE_TRACE ("ACE_Service_Repository_Iterator::valid");
00498   return (this->ignore_suspended_ == 0
00499           || this->svc_rep_.service_vector_[this->next_]->active ());
00500 }

Member Data Documentation


Declare the dynamic allocation hooks.

Definition at line 198 of file Service_Repository.h.

int ACE_Service_Repository_Iterator::ignore_suspended_ [private]

Are we ignoring suspended services?

Definition at line 212 of file Service_Repository.h.

Referenced by valid().

size_t ACE_Service_Repository_Iterator::next_ [private]

Next index location that we haven't yet seen.

Definition at line 209 of file Service_Repository.h.

ACE_Service_Repository& ACE_Service_Repository_Iterator::svc_rep_ [private]

Reference to the Service Repository we are iterating over.

Definition at line 206 of file Service_Repository.h.

The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:29:25 2006 for ACE by doxygen 1.3.6