ACE_Registry::Binding_Iterator::Object_Iteration Class Reference

Inheritance diagram for ACE_Registry::Binding_Iterator::Object_Iteration:

Inheritance graph
[legend]
Collaboration diagram for ACE_Registry::Binding_Iterator::Object_Iteration:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Object_Iteration (Binding_Iterator &iterator)
int next_n (u_long how_many, Binding_List &list)
 Next entries.


Constructor & Destructor Documentation

ACE_Registry::Binding_Iterator::Object_Iteration::Object_Iteration Binding_Iterator iterator  ) 
 

Definition at line 849 of file Registry.cpp.

00850   : Iteration_State (iter)
00851 {
00852 }


Member Function Documentation

int ACE_Registry::Binding_Iterator::Object_Iteration::next_n u_long  how_many,
Binding_List list
[virtual]
 

Next entries.

Implements ACE_Registry::Binding_Iterator::Iteration_State.

Definition at line 939 of file Registry.cpp.

References ACE_TCHAR, ACE_Registry::Binding_List, ACE_Registry::Binding_Iterator::current_enumeration(), and ACE_Unbounded_Set< T >::insert().

00941 {
00942   // Make a copy
00943   u_long requested = how_many;
00944 
00945   // While there are more entries to be added to the list
00946   while (how_many > 0)
00947     {
00948       ACE_TCHAR string [ACE_Registry::Naming_Context::MAX_OBJECT_NAME_SIZE];
00949       u_long size = sizeof string / sizeof (ACE_TCHAR);
00950       long result = ACE_TEXT_RegEnumValue (this->parent_->naming_context ().key (),
00951                                            this->index_,
00952                                            string,
00953                                            &size,
00954                                            0,
00955                                            0,
00956                                            0,
00957                                            0);
00958       switch (result)
00959         {
00960         case ERROR_SUCCESS:
00961           // Object found
00962           {
00963             // Readjust counters
00964             this->index_++;
00965             how_many--;
00966 
00967             // Add to list
00968             // Create binding
00969             Binding binding (string, OBJECT);
00970             // Add to binding list
00971             list.insert (binding);
00972           }
00973         // Continue to add to list
00974         break;
00975 
00976         case ERROR_NO_MORE_ITEMS:
00977           // Enumeration of objects complete
00978           // Reset index
00979           this->index_ = 0;
00980 
00981           // Current enumeration will become CONTEXTS
00982           this->parent_->current_enumeration (this->parent_->context_iteration_);
00983           result = this->parent_->current_enumeration ().next_n (how_many,
00984                                                                  list);
00985           // If we were able to add objects
00986           if (requested != how_many)
00987             return 0;
00988           else
00989             return result;
00990 
00991         default:
00992           // Strange error
00993           // Reset index
00994           this->index_ = 0;
00995           // Current enumeration will become COMPLETE
00996           this->parent_->current_enumeration (this->parent_->iteration_complete_);
00997           // strange error
00998           return -1;
00999         }
01000     }
01001   // If we reach here, all of <how_many> pairs were added to the list
01002   // Since more entries may be available
01003   // current enumeration will remain OBJECTS
01004   return 0;
01005 }


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