diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-31 21:48:20 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-31 21:48:20 +0000 |
commit | 86c5f836d1a679208716a422839d7da38ba41059 (patch) | |
tree | 1b3da514a0eb2064d0b27c62011db9492387b7dc /netsvcs/clients/Naming/Client/Client_Test.cpp | |
parent | 13c10349a654c59c85bb62c7f7b9ab8e1424814c (diff) | |
download | ATCD-86c5f836d1a679208716a422839d7da38ba41059.tar.gz |
added ACE_HAS_INSTANTIATION_PRAGMA support
Diffstat (limited to 'netsvcs/clients/Naming/Client/Client_Test.cpp')
-rw-r--r-- | netsvcs/clients/Naming/Client/Client_Test.cpp | 87 |
1 files changed, 45 insertions, 42 deletions
diff --git a/netsvcs/clients/Naming/Client/Client_Test.cpp b/netsvcs/clients/Naming/Client/Client_Test.cpp index 36fd6ba1317..e26416f7459 100644 --- a/netsvcs/clients/Naming/Client/Client_Test.cpp +++ b/netsvcs/clients/Naming/Client/Client_Test.cpp @@ -13,70 +13,70 @@ public: int open (void); // Cache reactor and then register self with reactor - + int close (void); // Close things down and free up resources. - + virtual int handle_input (ACE_HANDLE handle); // Handle user entered commands virtual int init (int argc, char *argv[]); // Initialize name options and naming context when dynamically // linked. - + virtual int fini (void); // Close down the test when dynamically unlinked. - + void list_options (void); // Print name options - + int bind (char *key, char *value, char *type = ""); // Bind a key to a value - + int unbind (char *key); // Unbind a name binding - + int rebind (char *key, char *value, char *type = ""); // Rebind a name binding - + int find (char *key); // Find the value associated with a key - + int list_names (char *pattern); // Find all names that match pattern - + int list_values (char *pattern); // Find all values that match pattern - + int list_types (char *pattern); // Find all types that match pattern - + int list_name_entries (char *pattern); // Find all names that match pattern - + int list_value_entries (char *pattern); // Find all values that match pattern int list_type_entries (char *pattern); // Find all types that match pattern - + private: ACE_Name_Options *name_options_; // Name Options associated with the Naming Context - + void display_menu (void); // Display user menu - + int set_proc_local (void); // Set options to use PROC_LOCAL naming context - + int set_node_local (void); // Set options to use NODE_LOCAL naming context - + int set_host (char *hostname, int port); - // Set options to use NET_LOCAL naming context + // Set options to use NET_LOCAL naming context // specifying host name and port number - + int quit (void); // Gracefully exit }; @@ -103,7 +103,7 @@ Client_Test::Client_Test (void) ACE_DEBUG ((LM_DEBUG, "Client_Test::Client_Test\n")); } -int +int Client_Test::init (int /* argc */, char * /* argv */ []) { ACE_DEBUG ((LM_DEBUG, "Client_Test::init\n")); @@ -130,12 +130,12 @@ int Client_Test::close (void) { // Deregister this handler with the ACE_Reactor. - return ACE_Reactor::instance ()->remove_handler - (ACE_STDIN, + return ACE_Reactor::instance ()->remove_handler + (ACE_STDIN, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK); } -int +int Client_Test::fini (void) { ACE_DEBUG ((LM_DEBUG, "Client_Test::fini\n")); @@ -155,10 +155,10 @@ Client_Test::handle_input (ACE_HANDLE) if (::scanf ("%s", option) <= 0) { - ACE_ERROR_RETURN ((LM_ERROR, "%p Try again!\n", + ACE_ERROR_RETURN ((LM_ERROR, "%p Try again!\n", "Client_Test::handle_input"), 0); } - + int result = -1; switch (isupper (option[0]) ? tolower (option[0]) : option[0]) @@ -316,7 +316,7 @@ Client_Test::display_menu (void) void Client_Test::list_options (void) { -// ACE_DEBUG ((LM_DEBUG, " *** Process Name is %s ***\n", +// ACE_DEBUG ((LM_DEBUG, " *** Process Name is %s ***\n", // this->name_options_->process_name ())); switch (this->name_options_->context ()) { @@ -327,16 +327,16 @@ Client_Test::list_options (void) ACE_DEBUG ((LM_DEBUG, " *** Using Node Local Database\n")); break; case ACE_Naming_Context::NET_LOCAL: - ACE_DEBUG ((LM_DEBUG, " *** Hostname: %s\n", + ACE_DEBUG ((LM_DEBUG, " *** Hostname: %s\n", this->name_options_->nameserver_host ())); - ACE_DEBUG ((LM_DEBUG, " *** Port Number: %d\n", + ACE_DEBUG ((LM_DEBUG, " *** Port Number: %d\n", this->name_options_->nameserver_port ())); break; - default: + default: assert (!"shouldn't occur!\n"); /* NOTREACHED */ } - ACE_DEBUG ((LM_DEBUG, " *** Namespace directory is %s ***\n", + ACE_DEBUG ((LM_DEBUG, " *** Namespace directory is %s ***\n", this->name_options_->namespace_dir ())); } @@ -360,7 +360,7 @@ Client_Test::set_node_local (void) return NAMING_CONTEXT ()->open (ACE_Naming_Context::NODE_LOCAL); } -int +int Client_Test::set_host (char* hostname, int port) { // Close down original name space @@ -370,18 +370,18 @@ Client_Test::set_host (char* hostname, int port) // Set Name Options this->name_options_->nameserver_host (hostname); this->name_options_->nameserver_port (port); - + return NAMING_CONTEXT ()->open (ACE_Naming_Context::NET_LOCAL); } -int +int Client_Test::quit (void) { // Send ourselves a SIGINT! return ACE_OS::kill (ACE_OS::getpid (), SIGINT); } -int +int Client_Test::bind (char* key, char* value, char* type) { if (NAMING_CONTEXT ()->bind (key, value, type) != 0) @@ -390,7 +390,7 @@ Client_Test::bind (char* key, char* value, char* type) return 0; } -int +int Client_Test::unbind (char* key) { if (NAMING_CONTEXT ()->unbind (key) != 0) @@ -399,7 +399,7 @@ Client_Test::unbind (char* key) return 0; } -int +int Client_Test::rebind (char* key, char* value, char* type) { int result = NAMING_CONTEXT ()->rebind (key, value, type ); @@ -540,7 +540,7 @@ Client_Test::list_type_entries (char *pattern) } -int +int Client_Test::find (char *key) { char *value = 0; @@ -551,8 +551,8 @@ Client_Test::find (char *key) "Client_Test::list_find", key), 0); else { - ACE_DEBUG ((LM_DEBUG, - "Binding for %s : value = %s\ttype = %s\n", + ACE_DEBUG ((LM_DEBUG, + "Binding for %s : value = %s\ttype = %s\n", key, value, type)); if (type) delete [] type; @@ -561,6 +561,9 @@ Client_Test::find (char *key) } -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Dynamic_Service<ACE_Naming_Context>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Dynamic_Service<ACE_Naming_Context> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + |