#include <Iterator.h>
Collaboration diagram for ImR_Iterator:
Public Member Functions | |
ImR_Iterator (CORBA::ULong n, Locator_Repository &repo, PortableServer::POA_ptr poa) | |
virtual CORBA::Boolean | next_n (CORBA::ULong how_many, ImplementationRepository::ServerInformationList_out server_list) |
virtual void | destroy (void) |
Private Attributes | |
Locator_Repository & | repo_ |
CORBA::ULong | count_ |
PortableServer::POA_ptr | poa_ |
Definition at line 31 of file Iterator.h.
|
Definition at line 15 of file Iterator.cpp.
|
|
Definition at line 82 of file Iterator.cpp.
|
|
Returns the next list of up to servers. If empty, will return false. Definition at line 24 of file Iterator.cpp. References ACE_ASSERT, ACE_NEW_THROW_EX, Server_Info_Ptr, and Locator_Repository::servers().
00026 { 00027 ACE_NEW_THROW_EX (server_list, 00028 ImplementationRepository::ServerInformationList(0), CORBA::NO_MEMORY()); 00029 00030 Locator_Repository::SIMap::ENTRY* entry = 0; 00031 Locator_Repository::SIMap::ITERATOR it (this->repo_.servers ()); 00032 00033 // Number of servers that will go into the server_list. 00034 CORBA::ULong n = this->repo_.servers().current_size(); 00035 if (n <= this->count_) 00036 { 00037 return 0; // We already finished. 00038 } 00039 else 00040 { 00041 n -= this->count_; 00042 } 00043 00044 if (how_many > 0 && n > how_many) 00045 { 00046 n = how_many; 00047 } 00048 00049 server_list->length (n); 00050 00051 CORBA::ULong i = 0; 00052 for (; i < this->count_; ++i) 00053 { 00054 it.advance (); 00055 } 00056 00057 for (i = 0; i < n; ++i) 00058 { 00059 it.next (entry); 00060 it.advance (); 00061 ACE_ASSERT(entry != 0); 00062 00063 Server_Info_Ptr info = entry->int_id_; 00064 00065 server_list[i].server = info->name.c_str (); 00066 server_list[i].startup.command_line = info->cmdline.c_str (); 00067 server_list[i].startup.environment = info->env_vars; 00068 server_list[i].startup.working_directory = info->dir.c_str (); 00069 server_list[i].startup.activation = info->activation_mode; 00070 server_list[i].startup.activator = info->activator.c_str (); 00071 server_list[i].startup.start_limit = info->start_limit; 00072 server_list[i].partial_ior = info->partial_ior.c_str (); 00073 } 00074 00075 this->count_ += n; 00076 00077 return 1; 00078 } |
|
Definition at line 48 of file Iterator.h. |
|
Definition at line 49 of file Iterator.h. |
|
Definition at line 47 of file Iterator.h. |