

Public Methods | |
| Object_Iteration (Binding_Iterator &iterator) | |
| int | next_n (u_long how_many, Binding_List &list) |
| Next <how_many> entries. More... | |
|
|
Definition at line 845 of file Registry.cpp. References ACE_Registry::Binding_Iterator::Binding_Iterator, and ACE_Registry::Binding_Iterator::Iteration_State.
00846 : Iteration_State (iter) 00847 { 00848 } |
|
||||||||||||
|
Next <how_many> entries.
Implements ACE_Registry::Binding_Iterator::Iteration_State. Definition at line 935 of file Registry.cpp. References ACE_TCHAR, ACE_Registry::Binding_Iterator::Iteration_State::index_, ACE_Unbounded_Set::insert, ACE_Registry::Naming_Context::MAX_OBJECT_NAME_SIZE, and ACE_Registry::Binding_Iterator::Iteration_State::parent_.
00937 {
00938 // Make a copy
00939 u_long requested = how_many;
00940
00941 // While there are more entries to be added to the list
00942 while (how_many > 0)
00943 {
00944 ACE_TCHAR string [ACE_Registry::Naming_Context::MAX_OBJECT_NAME_SIZE];
00945 u_long size = sizeof string / sizeof (ACE_TCHAR);
00946 long result = ACE_TEXT_RegEnumValue (this->parent_->naming_context ().key (),
00947 this->index_,
00948 string,
00949 &size,
00950 0,
00951 0,
00952 0,
00953 0);
00954 switch (result)
00955 {
00956 case ERROR_SUCCESS:
00957 // Object found
00958 {
00959 // Readjust counters
00960 this->index_++;
00961 how_many--;
00962
00963 // Add to list
00964 // Create binding
00965 Binding binding (string, OBJECT);
00966 // Add to binding list
00967 list.insert (binding);
00968 }
00969 // Continue to add to list
00970 break;
00971
00972 case ERROR_NO_MORE_ITEMS:
00973 // Enumeration of objects complete
00974 // Reset index
00975 this->index_ = 0;
00976
00977 // Current enumeration will become CONTEXTS
00978 this->parent_->current_enumeration (this->parent_->context_iteration_);
00979 result = this->parent_->current_enumeration ().next_n (how_many,
00980 list);
00981 // If we were able to add objects
00982 if (requested != how_many)
00983 return 0;
00984 else
00985 return result;
00986
00987 default:
00988 // Strange error
00989 // Reset index
00990 this->index_ = 0;
00991 // Current enumeration will become COMPLETE
00992 this->parent_->current_enumeration (this->parent_->iteration_complete_);
00993 // strange error
00994 return -1;
00995 }
00996 }
00997 // If we reach here, all of <how_many> pairs were added to the list
00998 // Since more entries may be available
00999 // current enumeration will remain OBJECTS
01000 return 0;
01001 }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002