diff options
-rw-r--r-- | ChangeLog-98a | 3 | ||||
-rw-r--r-- | TAO/ChangeLog-98c | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/Naming_Service.h | 19 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp | 33 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h | 6 | ||||
-rw-r--r-- | TAO/tao/Makefile | 178 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/tao.bld | 2 | ||||
-rw-r--r-- | ace/Arg_Shifter.cpp (renamed from TAO/tao/Arg_Shifter.cpp) | 18 | ||||
-rw-r--r-- | ace/Arg_Shifter.h (renamed from TAO/tao/Arg_Shifter.h) | 46 |
10 files changed, 82 insertions, 246 deletions
diff --git a/ChangeLog-98a b/ChangeLog-98a index 5298c616165..a912846885f 100644 --- a/ChangeLog-98a +++ b/ChangeLog-98a @@ -1,5 +1,8 @@ Fri May 1 13:52:32 1998 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + * ace: Added Arg_Shifter from TAO and renamed it to + ACE_Arg_Shifter. + * ace/IOStream_T.i (recv_n): ACE_IOStream<STREAM>::eof (void) had a subtle bug if it is called when a get operation (>>) has not failed. Thanks to James CE Johnson <ace-users@lads.com> for diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 33a1183dec4..fb990907824 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,8 @@ +Fri May 1 17:14:32 1998 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + + * tao/Makefile: Moved the Arg_Shifter from TAO to ACE since it is + generic and not TAO-specific. + Fri May 1 13:05:56 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu> * tao/Stub.h: Added a new structure called TAO_Exception_Data that diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.h b/TAO/orbsvcs/Naming_Service/Naming_Service.h index c64444ca8a9..bcb8da6ca7d 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.h +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.h @@ -1,4 +1,5 @@ // $Id$ + // ============================================================================ // // = LIBRARY @@ -23,35 +24,31 @@ class Naming_Service { - // =TITLE + // = TITLE // Defines a class that encapsulates the implementation of a // naming service. // - // =DESCRIPTION + // = DESCRIPTION // This class makes use of the TAO_Naming_Server and // TAO_ORB_Manager class to implement the Naming_Service. - public: Naming_Service (void); // Default Constructor. - Naming_Service (int argc, char* argv[]); + Naming_Service (int argc, char *argv[]); // Constructor taking the command-line arguments. - - int - init (int argc, char* argv[]); + int init (int argc, char *argv[]); // Initialize the Naming Service with the arguments. - int - run (CORBA_Environment& env); - // Run the Naming_Service + int run (CORBA_Environment& env); + // Run the Naming_Service. ~Naming_Service (void); // Destructor. private: - int parse_args (int argc,char *argv[]); + int parse_args (int argc, char *argv[]); // parses the arguments. TAO_ORB_Manager orb_manager_; diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp index 470bf525765..6d3b0324672 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp @@ -17,9 +17,9 @@ // // ============================================================================ +#include "ace/Arg_Shifter.h" #include "orbsvcs/CosNamingC.h" #include "tao/corba.h" -#include "tao/Arg_Shifter.h" #include "Naming_Utils.h" // Default constructor @@ -33,7 +33,8 @@ TAO_Naming_Server::TAO_Naming_Server (void) TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_var &orb, PortableServer::POA_var &child_poa, - int argc, char **argv) + int argc, + char **argv) { this->init (orb, child_poa, argc, argv); } @@ -44,11 +45,12 @@ TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_var &orb, int TAO_Naming_Server::init (CORBA::ORB_var &orb, PortableServer::POA_var &child_poa, - int argc, char **argv) + int argc, + char **argv) { - // Parse command line arguments to determine if this name server instance - // is part of a naming tree, under the default name server - Arg_Shifter args (argc, argv); + // Parse command line arguments to determine if this name server + // instance is part of a naming tree, under the default name server. + ACE_Arg_Shifter args (argc, argv); while (args.is_anything_left ()) { @@ -71,10 +73,12 @@ TAO_Naming_Server::init (CORBA::ORB_var &orb, TAO_TRY { - // Check if this invocation is creating a naming context different - // from the default NameService context, if not, instantiate a name - // service, and listen on multicast port. - if (ACE_OS::strcmp (this->naming_context_name_, "NameService") == 0) + // Check if this invocation is creating a naming context + // different from the default NameService context, if not, + // instantiate a name service, and listen on multicast port. + + if (ACE_OS::strcmp (this->naming_context_name_, + "NameService") == 0) { PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId (this->naming_context_name_); @@ -84,9 +88,9 @@ TAO_Naming_Server::init (CORBA::ORB_var &orb, TAO_TRY_ENV); TAO_CHECK_ENV; - // Stringify the objref we'll be implementing, and print it to - // stdout. Someone will take that string and give it to a - // client. Then release the object. + // Stringify the objref we'll be implementing, and print it + // to stdout. Someone will take that string and give it to + // a client. Then release the object. CORBA::Object_var obj = child_poa->id_to_reference (id.in (), TAO_TRY_ENV); @@ -197,7 +201,8 @@ TAO_Naming_Server::init (CORBA::ORB_var &orb, ctx_name.length (1); ctx_name[0].id = CORBA::string_dup (naming_context_name_); - default_ctx->bind_context (ctx_name, naming_context_impl_._this (TAO_TRY_ENV), + default_ctx->bind_context (ctx_name, + naming_context_impl_._this (TAO_TRY_ENV), TAO_TRY_ENV); TAO_CHECK_ENV; diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h index fc3efb904d6..99aef9f4f70 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h @@ -43,13 +43,15 @@ public: TAO_Naming_Server (CORBA::ORB_var &orb, PortableServer::POA_var &root_poa, - int argc, char **argv); + int argc = 0, + char **argv = 0); // Takes the POA under which to register the Naming Service // implementation object. int init (CORBA::ORB_var &orb, PortableServer::POA_var &root_poa, - int argc, char **argv); + int argc = 0, + char **argv = 0); // Initialize the name server under the given ORB and POA. NS_NamingContext &GetNamingContext (void); diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index 8835b01cb9c..0780b1b3ede 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -33,7 +33,6 @@ ORBCORE_SRCS = \ Server_Request \ Stub \ Typecode \ - Arg_Shifter \ CDR \ Client_Strategy_Factory \ Connect \ @@ -2598,182 +2597,6 @@ LDFLAGS += $(RLDFLAGS) $(TAO_ROOT)/tao/GIOP.h \ $(TAO_ROOT)/tao/GIOP.i \ $(TAO_ROOT)/tao/singletons.h -.obj/Arg_Shifter.o .obj/Arg_Shifter.so .shobj/Arg_Shifter.o .shobj/Arg_Shifter.so: Arg_Shifter.cpp Arg_Shifter.h -.obj/CDR.o .obj/CDR.so .shobj/CDR.o .shobj/CDR.so: CDR.cpp $(TAO_ROOT)/tao/corba.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Get_Opt.h \ - $(ACE_ROOT)/ace/Get_Opt.i \ - $(ACE_ROOT)/ace/SOCK_Stream.h \ - $(ACE_ROOT)/ace/SOCK_IO.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_IO.i \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK_Stream.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager.h \ - $(ACE_ROOT)/ace/SString.h \ - $(ACE_ROOT)/ace/SString.i \ - $(ACE_ROOT)/ace/SOCK_Acceptor.h \ - $(ACE_ROOT)/ace/Time_Value.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.i \ - $(ACE_ROOT)/ace/SOCK_Connector.h \ - $(ACE_ROOT)/ace/SOCK_Connector.i \ - $(ACE_ROOT)/ace/Strategies.h \ - $(ACE_ROOT)/ace/Strategies_T.h \ - $(ACE_ROOT)/ace/Service_Config.h \ - $(ACE_ROOT)/ace/Service_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.i \ - $(ACE_ROOT)/ace/Service_Object.i \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Service_Config.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ - $(ACE_ROOT)/ace/Synch_Options.h \ - $(ACE_ROOT)/ace/Connector.h \ - $(ACE_ROOT)/ace/Map_Manager.h \ - $(ACE_ROOT)/ace/Map_Manager.i \ - $(ACE_ROOT)/ace/Svc_Handler.h \ - $(ACE_ROOT)/ace/Task.h \ - $(ACE_ROOT)/ace/Thread_Manager.h \ - $(ACE_ROOT)/ace/Thread_Manager.i \ - $(ACE_ROOT)/ace/Task.i \ - $(ACE_ROOT)/ace/Task_T.h \ - $(ACE_ROOT)/ace/Message_Queue.h \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ - $(ACE_ROOT)/ace/Message_Queue.i \ - $(ACE_ROOT)/ace/Task_T.i \ - $(ACE_ROOT)/ace/Dynamic.h \ - $(ACE_ROOT)/ace/Dynamic.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Svc_Handler.i \ - $(ACE_ROOT)/ace/Connector.i \ - $(ACE_ROOT)/ace/Acceptor.h \ - $(ACE_ROOT)/ace/Acceptor.i \ - $(TAO_ROOT)/tao/compat/objbase.h \ - $(TAO_ROOT)/tao/compat/initguid.h \ - $(TAO_ROOT)/tao/orbconf.h \ - $(TAO_ROOT)/tao/Align.h \ - $(TAO_ROOT)/tao/ORB.h \ - $(TAO_ROOT)/tao/Sequence.h \ - $(TAO_ROOT)/tao/Sequence.i \ - $(TAO_ROOT)/tao/Sequence_T.h \ - $(TAO_ROOT)/tao/Sequence_T.i \ - $(TAO_ROOT)/tao/Object_KeyC.h \ - $(TAO_ROOT)/tao/Object_KeyC.i \ - $(TAO_ROOT)/tao/ORB.i \ - $(TAO_ROOT)/tao/Exception.h \ - $(TAO_ROOT)/tao/Exception.i \ - $(TAO_ROOT)/tao/Any.h \ - $(TAO_ROOT)/tao/Any.i \ - $(TAO_ROOT)/tao/params.h \ - $(TAO_ROOT)/tao/params.i \ - $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ - $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ - $(TAO_ROOT)/tao/default_client.h \ - $(TAO_ROOT)/tao/default_client.i \ - $(TAO_ROOT)/tao/default_server.h \ - $(TAO_ROOT)/tao/ORB_Strategies_T.h \ - $(TAO_ROOT)/tao/ORB_Strategies_T.i \ - $(TAO_ROOT)/tao/default_server.i \ - $(TAO_ROOT)/tao/NVList.h \ - $(TAO_ROOT)/tao/NVList.i \ - $(TAO_ROOT)/tao/Principal.h \ - $(TAO_ROOT)/tao/Request.h \ - $(TAO_ROOT)/tao/Request.i \ - $(TAO_ROOT)/tao/Stub.h \ - $(TAO_ROOT)/tao/Stub.i \ - $(TAO_ROOT)/tao/Object.h \ - $(TAO_ROOT)/tao/Object.i \ - $(TAO_ROOT)/tao/Server_Request.h \ - $(TAO_ROOT)/tao/Server_Request.i \ - $(TAO_ROOT)/tao/Typecode.h \ - $(TAO_ROOT)/tao/Typecode.i \ - $(TAO_ROOT)/tao/Marshal.h \ - $(TAO_ROOT)/tao/Marshal.i \ - $(TAO_ROOT)/tao/CDR.h \ - $(TAO_ROOT)/tao/CDR.i \ - $(TAO_ROOT)/tao/POA.h \ - $(TAO_ROOT)/tao/POAC.h \ - $(TAO_ROOT)/tao/POAC.i \ - $(TAO_ROOT)/tao/Servant_Base.h \ - $(TAO_ROOT)/tao/POAS.h \ - $(TAO_ROOT)/tao/POAS.i \ - $(TAO_ROOT)/tao/Object_Table.h \ - $(TAO_ROOT)/tao/Connect.h \ - $(TAO_ROOT)/tao/Connect.i \ - $(TAO_ROOT)/tao/ORB_Core.h \ - $(TAO_ROOT)/tao/ORB_Core.i \ - $(ACE_ROOT)/ace/Dynamic_Service.h \ - $(TAO_ROOT)/tao/Operation_Table.h \ - $(TAO_ROOT)/tao/debug.h \ - $(TAO_ROOT)/tao/IIOP_Object.h \ - $(TAO_ROOT)/tao/IIOP_Object.i \ - $(TAO_ROOT)/tao/IIOP_ORB.h \ - $(TAO_ROOT)/tao/IIOP_ORB.i \ - $(TAO_ROOT)/tao/IIOP_Interpreter.h \ - $(TAO_ROOT)/tao/GIOP.h \ - $(TAO_ROOT)/tao/GIOP.i \ - $(TAO_ROOT)/tao/singletons.h .obj/Client_Strategy_Factory.o .obj/Client_Strategy_Factory.so .shobj/Client_Strategy_Factory.o .shobj/Client_Strategy_Factory.so: Client_Strategy_Factory.cpp \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ @@ -5957,7 +5780,6 @@ LDFLAGS += $(RLDFLAGS) $(ACE_ROOT)/ace/Env_Value_T.h \ $(ACE_ROOT)/ace/Env_Value_T.i \ $(TAO_ROOT)/tao/TAO_Internal.h \ - $(TAO_ROOT)/tao/Arg_Shifter.h .obj/params.o .obj/params.so .shobj/params.o .shobj/params.so: params.cpp $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/inc_user_config.h \ diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index c14c2da1e96..12c8068bf44 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -5,8 +5,8 @@ #include "ace/Service_Repository.h" #include "ace/Select_Reactor.h" #include "ace/Env_Value_T.h" +#include "ace/Arg_Shifter.h" #include "tao/TAO_Internal.h" -#include "tao/Arg_Shifter.h" #if !defined (__ACE_INLINE__) # include "tao/ORB_Core.i" @@ -63,7 +63,7 @@ TAO_ORB_Core::init (int& argc, char** argv) // than argv[0]. I don't think that's wise. I think we need to // change that convention to argv[0] and let the initializing code // make any necessary shifts. - + // // Parse arguments to the ORB. Typically the ORB is passed // arguments straight from the command line, so we will simply pass // through them and respond to the ones we understand and ignore @@ -72,21 +72,21 @@ TAO_ORB_Core::init (int& argc, char** argv) // In some instances, we may actually build another vector of // arguments and stash it for use initializing other components such // as the ACE_Service_Config or the RootPOA. + // + // Prepare a copy of the argument vector. - // Prepare a copy of the argument vector - char **svc_config_argv; // @@ Should this be a data member? - // Probably, but there's no object in which to scope it. + char **svc_config_argv; int svc_config_argc = 0; ACE_NEW_RETURN (svc_config_argv, char *[argc + 1], 0); // Be certain to copy the program name so that service configurator // has something to skip! - Arg_Shifter arg_shifter(argc, argv); + ACE_Arg_Shifter arg_shifter (argc, argv); svc_config_argv[svc_config_argc++] = argv[0]; - ACE_Env_Value<int> defport(quote(TAO_DEFAULT_SERVER_PORT), - TAO_DEFAULT_SERVER_PORT); + ACE_Env_Value<int> defport (quote (TAO_DEFAULT_SERVER_PORT), + TAO_DEFAULT_SERVER_PORT); CORBA::String_var host = CORBA::string_dup (""); CORBA::UShort port = defport; CORBA::Boolean use_ior = CORBA::B_TRUE; @@ -124,7 +124,7 @@ TAO_ORB_Core::init (int& argc, char** argv) if (arg_shifter.is_parameter_next ()) { - char* file_name = arg_shifter.get_current (); + char *file_name = arg_shifter.get_current (); // Should we dup the string before assigning? svc_config_argv[svc_config_argc++] = file_name; arg_shifter.consume_arg(); diff --git a/TAO/tao/tao.bld b/TAO/tao/tao.bld index bbdea12fe5c..ae477754d64 100644 --- a/TAO/tao/tao.bld +++ b/TAO/tao/tao.bld @@ -4,8 +4,6 @@ default: :defines=DEBUG Any.cpp C++ -Arg_Shifter.cpp - C++ CDR.cpp C++ Client_Strategy_Factory.cpp diff --git a/TAO/tao/Arg_Shifter.cpp b/ace/Arg_Shifter.cpp index 8e8dc51aa34..a988fa27928 100644 --- a/TAO/tao/Arg_Shifter.cpp +++ b/ace/Arg_Shifter.cpp @@ -2,7 +2,7 @@ #include "Arg_Shifter.h" -Arg_Shifter::Arg_Shifter (int &argc, char **argv, char **temp) +ACE_Arg_Shifter::ACE_Arg_Shifter (int &argc, char **argv, char **temp) : argc_ (argc), total_size_ (argc), temp_ (temp), @@ -33,14 +33,14 @@ Arg_Shifter::Arg_Shifter (int &argc, char **argv, char **temp) } } -Arg_Shifter::~Arg_Shifter (void) +ACE_Arg_Shifter::~ACE_Arg_Shifter (void) { // Delete the temporary vector. delete [] temp_; } char * -Arg_Shifter::get_current (void) const +ACE_Arg_Shifter::get_current (void) const { char *return_value = 0; @@ -51,7 +51,7 @@ Arg_Shifter::get_current (void) const } int -Arg_Shifter::consume_arg (int number) +ACE_Arg_Shifter::consume_arg (int number) { int return_value = 0; @@ -71,7 +71,7 @@ Arg_Shifter::consume_arg (int number) } int -Arg_Shifter::ignore_arg (int number) +ACE_Arg_Shifter::ignore_arg (int number) { int return_value = 0; @@ -91,27 +91,27 @@ Arg_Shifter::ignore_arg (int number) } int -Arg_Shifter::is_anything_left (void) const +ACE_Arg_Shifter::is_anything_left (void) const { return this->total_size_ - this->current_index_; } int -Arg_Shifter::is_option_next (void) const +ACE_Arg_Shifter::is_option_next (void) const { return this->is_anything_left () && this->temp_[this->current_index_][0] == '-'; } int -Arg_Shifter::is_parameter_next (void) const +ACE_Arg_Shifter::is_parameter_next (void) const { return this->is_anything_left () && this->temp_[this->current_index_][0] != '-'; } int -Arg_Shifter::num_ignored_args (void) const +ACE_Arg_Shifter::num_ignored_args (void) const { return this->front_; } diff --git a/TAO/tao/Arg_Shifter.h b/ace/Arg_Shifter.h index d0952b48e01..537c6cabadf 100644 --- a/TAO/tao/Arg_Shifter.h +++ b/ace/Arg_Shifter.h @@ -4,7 +4,7 @@ // ======================================================================== // // = LIBRARY -// TAO +// ace // // = FILENAME // Arg_Shifter.h @@ -14,10 +14,10 @@ // // ======================================================================== -#if !defined (TAO_ARG_SHIFTER_H) -#define TAO_ARG_SHIFTER_H +#if !defined (ACE_ARG_SHIFTER_H) +#define ACE_ARG_SHIFTER_H -class Arg_Shifter +class ACE_Arg_Shifter { // = TITLE // This ADT shifts known args to the back of the argv vector, so @@ -25,24 +25,28 @@ class Arg_Shifter // unprocessed arguments at the beginning of the vector. // // = DESCRIPTION - // The Arg_Shifter copies the pointers of the argv vector into a - // temporary array. As the Arg_Shifter iterates over the temp, is - // places known arguments in the rear of the argv and unknown - // ones in the beginning. So, after having visited all the - // arguments in the temp vector, Arg_Shifter has placed all the - // unknown arguments in their original order at the front of - // argv. + // The <ACE_Arg_Shifter> copies the pointers of the argv vector + // into a temporary array. As the <ACE_Arg_Shifter> iterates over + // the temp, is places known arguments in the rear of the argv + // and unknown ones in the beginning. So, after having visited + // all the arguments in the temp vector, <ACE_Arg_Shifter> has + // placed all the unknown arguments in their original order at + // the front of argv. public: - Arg_Shifter (int &argc, char **argv, char **temp = 0); - // Initialize the Arg_Shifter to the vector over which to iterate, - // also providing the temporary array if the client doesn't want the - // arg_shifter to dynamically allocate its own. If internal dynamic - // allocation fails, the Arg_Shifter will set all the indices to the - // end of the vector, forbidding iteration. Following iteration over - // argv, the argc value will contain the number of unconsumed - // arguments. + // = Initialization and termination methods. + ACE_Arg_Shifter (int &argc, + char **argv, + char **temp = 0); + // Initialize the <ACE_Arg_Shifter> to the vector over which to + // iterate, also providing the temporary array if the client doesn't + // want the arg_shifter to dynamically allocate its own. If internal + // dynamic allocation fails, the <ACE_Arg_Shifter> will set all the + // indices to the end of the vector, forbidding iteration. Following + // iteration over argv, the argc value will contain the number of + // unconsumed arguments. - ~Arg_Shifter (void); + ~ACE_Arg_Shifter (void); + // Destructor. char *get_current (void) const; // Get the current head of the vector. @@ -94,4 +98,4 @@ private: // argument. }; -#endif /* TAO_ARG_SHIFTER_H */ +#endif /* ACE_ARG_SHIFTER_H */ |