diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-06-27 02:30:37 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-06-27 02:30:37 +0000 |
commit | a6e9d93d7332f4631f16fb9a66cc2dd7559061a1 (patch) | |
tree | 72911aac221b9a8cb74c91fe2631da452de8be8d | |
parent | 2fd9f6213d141bb274e42eda82b86d222bb94b8d (diff) | |
download | ATCD-a6e9d93d7332f4631f16fb9a66cc2dd7559061a1.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO-inheritance.pdf.gz | bin | 0 -> 12009 bytes | |||
-rw-r--r-- | TAO-inheritance.ps.gz | bin | 0 -> 11651 bytes | |||
-rw-r--r-- | TAO/ChangeLog-98c | 6 | ||||
-rw-r--r-- | TAO/docs/components.html | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp | 48 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Log/Logger_i.h | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Logger.idl | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Logger/Makefile | 13 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Logger/client.cpp (renamed from TAO/orbsvcs/tests/Logger/clnt.cpp) | 140 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Logger/client.h (renamed from TAO/orbsvcs/tests/Logger/clnt.h) | 18 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Logger/server.cpp (renamed from TAO/orbsvcs/tests/Logger/svr.cpp) | 0 | ||||
-rw-r--r-- | docs/ACE-inheritance.pdf.gz | bin | 17864 -> 19666 bytes | |||
-rw-r--r-- | docs/ACE-inheritance.ps.gz | bin | 18594 -> 18416 bytes |
13 files changed, 146 insertions, 96 deletions
diff --git a/TAO-inheritance.pdf.gz b/TAO-inheritance.pdf.gz Binary files differnew file mode 100644 index 00000000000..f44e92f9263 --- /dev/null +++ b/TAO-inheritance.pdf.gz diff --git a/TAO-inheritance.ps.gz b/TAO-inheritance.ps.gz Binary files differnew file mode 100644 index 00000000000..7634c2b076b --- /dev/null +++ b/TAO-inheritance.ps.gz diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index eafffcbc982..75e15982f57 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,9 @@ +Fri Jun 26 21:24:58 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * orbsvcs/tests/Logger: Rename clnt.{cpp,h} and svc.cpp to + client.{cpp,h} and server.cpp to be more consistent with other + naming schemes in TAO. + Fri Jun 26 16:57:54 1998 Carlos O'Ryan <coryan@cs.wustl.edu> * tao/encode.cpp: diff --git a/TAO/docs/components.html b/TAO/docs/components.html index 9e782b2709a..b5eb720dae4 100644 --- a/TAO/docs/components.html +++ b/TAO/docs/components.html @@ -28,6 +28,11 @@ bgcolor="#ffffff"> all request in one thread, each request in a separate thread, or each connection in a separate thread, <em>etc.</em><P> + <LI> Mapping of all <A + HREF="http://www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO/">TAO files</A> + into a manageable set of <A +HREF="http://www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO-inheritance.ps.gz">inheritance +hierarchies</A>. <P> </UL> </BODY> diff --git a/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp b/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp index e3fbdb56735..bf4e2a7e06c 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp @@ -4,7 +4,6 @@ #include "orbsvcs/LoggerC.h" #include "orbsvcs/Log/Logger_i.h" #include "ace/Log_Record.h" -#include "ace/OS.h" Logger_ptr Logger_Factory_i::make_logger (const char *name, @@ -31,19 +30,20 @@ Logger_i::~Logger_i (void) ACE_OS::free (this->name_); } -// This converts from the IDL defined Log_Priority enumerated type -// to the ACE_Log_Priority enumerated type +// This converts from the IDL defined Log_Priority enumerated type to +// the ACE_Log_Priority enumerated type + ACE_Log_Priority priority_conversion (const Logger::Log_Priority prior1) { if (prior1 == Logger::LM_MAX) - { - return LM_MAX; - } + return LM_MAX; else { int pval = ACE_static_cast (int, prior1); - return ACE_static_cast (ACE_Log_Priority, ACE_POW (pval)); + + return ACE_static_cast (ACE_Log_Priority, + ACE_POW (pval)); } } @@ -52,30 +52,38 @@ Logger_i::log (const Logger::Log_Record &log_rec, CORBA::Environment &_env) { ACE_Log_Record rec (priority_conversion (log_rec.type), - log_rec.time, log_rec.app_id); + log_rec.time, + log_rec.app_id); // Create a ACE_Log_Record in order to leverage existing logging - // code.The log2() is used because we can't specify values for - // enum tags in IDL, but ACE_Log_Priority values are powers of 2 + // code.The log2() is used because we can't specify values for enum + // tags in IDL, but ACE_Log_Priority values are powers of 2 // priority_names_() is essentially used to cast to the enum type - ASYS_TCHAR msgbuf[ACE_MAXLOGMSGLEN+1]; - ACE_OS::strncpy (msgbuf, (log_rec.msg_data), ACE_MAXLOGMSGLEN); + ASYS_TCHAR msgbuf[ACE_MAXLOGMSGLEN + 1]; + ACE_OS::strncpy (msgbuf, + log_rec.msg_data, + ACE_MAXLOGMSGLEN); // I don't think this is a good way to do this. Suggestions? rec.msg_data (msgbuf); // Set ACE_Log_Record.msg_data to the value stored in msgbuf hostent rhost; - char storage[MAXHOSTNAMELEN+1]; + char storage[MAXHOSTNAMELEN + 1]; - ACE_INET_Addr addy (0, ACE_static_cast (ACE_UINT32, log_rec.host_addr)); - // The constructor for ACE_INET_Addr requires a port number, which is not - // relevant in this context, so we give it 0. Is this ok? + ACE_INET_Addr addy (0, + ACE_static_cast (ACE_UINT32, + log_rec.host_addr)); + // The constructor for ACE_INET_Addr requires a port number, which + // is not relevant in this context, so we give it 0. - ASYS_TCHAR namebuf [MAXHOSTNAMELEN+1]; - addy.get_host_name(namebuf, MAXHOSTNAMELEN); + ASYS_TCHAR namebuf[MAXHOSTNAMELEN + 1]; + addy.get_host_name (namebuf, + MAXHOSTNAMELEN); - rec.print(namebuf, ACE_Log_Msg::VERBOSE, stderr); - // Print out the logging message to stderr + rec.print (namebuf, + ACE_Log_Msg::VERBOSE, + stderr); + // Print out the logging message to stderr. } diff --git a/TAO/orbsvcs/orbsvcs/Log/Logger_i.h b/TAO/orbsvcs/orbsvcs/Log/Logger_i.h index c074cdc2484..4e23244cadf 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Logger_i.h +++ b/TAO/orbsvcs/orbsvcs/Log/Logger_i.h @@ -11,8 +11,8 @@ // Logger_i.h // // = AUTHOR -// Marina Spivak <marina@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> +// Marina Spivak <marina@cs.wustl.edu>, +// Sergio Flores-Gaitan <sergio@cs.wustl.edu>, and // Matthew Braun <mjb2@cec.wustl.edu> // ============================================================================ @@ -24,7 +24,7 @@ class TAO_ORBSVCS_Export Logger_Factory_i : public virtual POA_Logger_Factory { // = TITLE - // Create a <Logger> of type <name>. + // Create a <Logger> of type <name>. public: Logger_Factory_i (void); // constructor. @@ -50,7 +50,7 @@ public: private: char *name_; - // logger identification + // Logger identification. }; #endif /* TAO_ORBSVCS_LOGGER_I_H */ diff --git a/TAO/orbsvcs/orbsvcs/Logger.idl b/TAO/orbsvcs/orbsvcs/Logger.idl index c1161e2797e..37c6bde9bc5 100644 --- a/TAO/orbsvcs/orbsvcs/Logger.idl +++ b/TAO/orbsvcs/orbsvcs/Logger.idl @@ -9,7 +9,6 @@ interface Logger // @@ This interface is very simple-minded and can certainly be // improved, e.g., by passing over more interesting logging // records similar to what we do in <ACE_Log_Msg>. - enum Log_Priority { @@ -55,7 +54,6 @@ interface Logger // being a distinct tag, but that is invalid IDL syntax. Make sure to // adjust for this }; - struct Log_Record { @@ -63,6 +61,7 @@ interface Logger long time; // Timestamp of the sender long app_id; // Process id of the sender long host_addr; // IP address of the sender + // @@ Matt, let's make this the same size as the max ACE_Log_Record string. string msg_data; // The logging message }; @@ -72,7 +71,6 @@ interface Logger // attribute char verbose; }; - interface Logger_Factory { // = TITLE diff --git a/TAO/orbsvcs/tests/Logger/Makefile b/TAO/orbsvcs/tests/Logger/Makefile index 595b2d196bf..3c89e34ef50 100644 --- a/TAO/orbsvcs/tests/Logger/Makefile +++ b/TAO/orbsvcs/tests/Logger/Makefile @@ -15,12 +15,12 @@ endif # ! TAO_ROOT LDLIBS = -lorbsvcs -lTAO -SRC = svr.cpp clnt.cpp +SRC = server.cpp client.cpp -logger_SVR_OBJS = svr.o -logger_CLT_OBJS = clnt.o +logger_SERVER_OBJS = server.o +logger_CLIENT_OBJS = client.o -BIN = svr clnt +BIN = server client BUILD = $(BIN) VLDLIBS = $(LDLIBS:%=%$(VAR)) @@ -40,10 +40,10 @@ TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H -svr: $(addprefix $(VDIR),$(logger_SVR_OBJS)) +server: $(addprefix $(VDIR),$(logger_SERVER_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) -clnt: $(addprefix $(VDIR),$(logger_CLT_OBJS)) +client: $(addprefix $(VDIR),$(logger_CLIENT_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) realclean: clean @@ -53,5 +53,4 @@ realclean: clean # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/Logger/clnt.cpp b/TAO/orbsvcs/tests/Logger/client.cpp index 4da8f10ebf8..8a66b4292e0 100644 --- a/TAO/orbsvcs/tests/Logger/clnt.cpp +++ b/TAO/orbsvcs/tests/Logger/client.cpp @@ -3,16 +3,16 @@ // ============================================================================ // // = LIBRARY -// TAO/orbsvcs/bin/Logger +// TAO/orbsvcs/tests/Logger // // = FILENAME -// clnt.cpp +// client.cpp // // = DESCRIPTION -// This program tests an implementation of a logger service. It uses the -// Logger_Factory server to create a number of logger objects. It then -// uses their object references to test functions supported by the -// logger server. +// This program tests an implementation of a logger service. It +// uses the Logger_Factory server to create a number of logger +// objects. It then uses their object references to test functions +// supported by the logger server. // // = AUTHORS // Sergio Flores-Gaitan @@ -24,7 +24,7 @@ #include "ace/OS.h" #include "orbsvcs/CosNamingC.h" #include "orbsvcs/LoggerC.h" -#include "clnt.h" +#include "client.h" // constructor @@ -69,32 +69,32 @@ Logger_Client::parse_args (void) } void -Logger_Client::setup_record (Logger::Log_Record newrec, Logger::Log_Priority lp, - const char* msg) +Logger_Client::setup_record (Logger::Log_Record newrec, + Logger::Log_Priority lp, + const char *msg) { - ACE_Time_Value time; - pid_t pid; - hostent *he; struct utsname h_name; - char msg_data[ACE_MAXLOGMSGLEN+1]; - ACE_OS::strncpy (msg_data, msg, ACE_MAXLOGMSGLEN); + ACE_OS::strncpy (msg_data, + msg, + ACE_MAXLOGMSGLEN); newrec.type = lp; - time = ACE_OS::gettimeofday(); - newrec.time = time.sec(); + ACE_Time_Value time = ACE_OS::gettimeofday (); + newrec.time = time.sec (); - pid = getpid(); + pid_t pid = ACE_OS::getpid (); newrec.app_id = pid; - ACE_OS::uname(&h_name); - he = (ACE_OS::gethostbyname (h_name.nodename)); - newrec.host_addr = inet_addr(he->h_addr); + ACE_OS::uname (&h_name); + hostent *he = (ACE_OS::gethostbyname (h_name.nodename)); - ACE_OS::strcpy ( newrec.msg_data, msg); -} + newrec.host_addr = inet_addr (he->h_addr); + ACE_OS::strcpy (newrec.msg_data, + msg); +} // Execute client example code. @@ -106,13 +106,16 @@ Logger_Client::run (void) Logger::Log_Record rec1; Logger::Log_Record rec2; - setup_record (rec1, Logger::LM_DEBUG, "Logging at logger 1"); + this->setup_record (rec1, + Logger::LM_DEBUG, + "Logging at logger 1"); this->logger_1_->log (rec1, TAO_TRY_ENV); TAO_CHECK_ENV; - - setup_record (rec2, Logger::LM_ERROR, "Logging at logger 2"); + this->setup_record (rec2, + Logger::LM_ERROR, + "Logging at logger 2"); this->logger_2_->log (rec2, TAO_TRY_ENV); TAO_CHECK_ENV; @@ -142,7 +145,10 @@ Logger_Client::init (int argc, char **argv) { // Initialize ORB. this->orb_ = - CORBA::ORB_init (argc, argv, "internet", TAO_TRY_ENV); + CORBA::ORB_init (argc, + argv, + "internet", + TAO_TRY_ENV); TAO_CHECK_ENV; CORBA::Object_var naming_obj = @@ -153,10 +159,12 @@ Logger_Client::init (int argc, char **argv) -1); CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV); + CosNaming::NamingContext::_narrow (naming_obj.in (), + TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, "Obtained naming_context\n")); + ACE_DEBUG ((LM_DEBUG, + "Obtained naming_context\n")); // Parse command line and verify parameters. if (this->parse_args () == -1) @@ -166,7 +174,8 @@ Logger_Client::init (int argc, char **argv) factory_name.length (1); factory_name[0].id = CORBA::string_dup ("logger_factory"); CORBA::Object_var factory_ref = - naming_context->resolve (factory_name, TAO_TRY_ENV); + naming_context->resolve (factory_name, + TAO_TRY_ENV); TAO_CHECK_ENV; /// The following resolve() must fail with an exception. @@ -176,7 +185,8 @@ Logger_Client::init (int argc, char **argv) factory_name2[0].id = CORBA::string_dup ("logger_factory2"); CORBA::Object_var factory_ref2 = - naming_context->resolve (factory_name2, TAO_TRY_ENV); + naming_context->resolve (factory_name2, + TAO_TRY_ENV); if (TAO_TRY_ENV.exception ()) { @@ -189,40 +199,56 @@ Logger_Client::init (int argc, char **argv) } if (CORBA::is_nil (factory_ref.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "resolved to nil object"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "resolved to nil object"), + -1); - ACE_DEBUG ((LM_DEBUG, "Logger_Factory resolved\n")); + ACE_DEBUG ((LM_DEBUG, + "Logger_Factory resolved\n")); Logger_Factory_var factory = - Logger_Factory::_narrow (factory_ref.in (), TAO_TRY_ENV); + Logger_Factory::_narrow (factory_ref.in (), + TAO_TRY_ENV); TAO_CHECK_ENV; if (CORBA::is_nil (factory.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "narrow returned nil"), -1); - - ACE_DEBUG ((LM_DEBUG, "Logger_Factory narrowed\n")); + ACE_ERROR_RETURN ((LM_ERROR, + "narrow returned nil"), + -1); + ACE_DEBUG ((LM_DEBUG, + "Logger_Factory narrowed\n")); CORBA::String_var str = - this->orb_->object_to_string (factory.in (), TAO_TRY_ENV); + this->orb_->object_to_string (factory.in (), + TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, "The factory IOR is <%s>\n", str.in ())); + ACE_DEBUG ((LM_DEBUG, + "The factory IOR is <%s>\n", + str.in ())); // Now retrieve the Logger obj ref corresponding to key1 and key2 - this->logger_1_ = factory->make_logger ("key1", TAO_TRY_ENV); + this->logger_1_ = factory->make_logger ("key1", + TAO_TRY_ENV); TAO_CHECK_ENV; - this->logger_2_ = factory->make_logger ("key2", TAO_TRY_ENV); + this->logger_2_ = factory->make_logger ("key2", + TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, "Created two loggers")); + ACE_DEBUG ((LM_DEBUG, + "Created two loggers")); if (CORBA::is_nil (this->logger_1_.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "nil logger1"), -1); - + ACE_ERROR_RETURN ((LM_ERROR, + "nil logger1"), + -1); if (CORBA::is_nil (this->logger_2_.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "nil logger2"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "nil logger2"), + -1); - ACE_DEBUG ((LM_DEBUG, "Created two loggers\n")); + ACE_DEBUG ((LM_DEBUG, + "Created two loggers\n")); if (this->test_nesting_) { @@ -235,28 +261,36 @@ Logger_Client::init (int argc, char **argv) TAO_CHECK_ENV; if (CORBA::is_nil (nc1.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "nil nested context"), -1); - - ACE_DEBUG ((LM_DEBUG, "Nested naming context created\n")); + ACE_ERROR_RETURN ((LM_ERROR, + "nil nested context"), + -1); + ACE_DEBUG ((LM_DEBUG, + "Nested naming context created\n")); CosNaming::Name logger1_name (1); logger1_name.length (1); logger1_name[0].id = CORBA::string_dup ("logger_1_"); - nc1->bind (logger1_name, this->logger_1_.in (), TAO_TRY_ENV); + nc1->bind (logger1_name, + this->logger_1_.in (), + TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, "Bind in nested context succeded\n")); + ACE_DEBUG ((LM_DEBUG, + "Bind in nested context succeded\n")); - nc1->unbind (logger1_name, TAO_TRY_ENV); + nc1->unbind (logger1_name, + TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, "Unbind in nested context succeded\n")); + ACE_DEBUG ((LM_DEBUG, + "Unbind in nested context succeded\n")); // destroy the naming context created above. nc1->destroy (TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, "destroy of nested context succeded\n")); + ACE_DEBUG ((LM_DEBUG, + "destroy of nested context succeded\n")); } } TAO_CATCHANY diff --git a/TAO/orbsvcs/tests/Logger/clnt.h b/TAO/orbsvcs/tests/Logger/client.h index 37085ac9ca0..ce4230a310f 100644 --- a/TAO/orbsvcs/tests/Logger/clnt.h +++ b/TAO/orbsvcs/tests/Logger/client.h @@ -4,10 +4,10 @@ // ============================================================================ // // = LIBRARY -// TAO/orbsvcs/bin/Logger +// TAO/orbsvcs/tests/Logger // // = FILENAME -// clnt.h +// client.h // // = DESCRIPTION // This program tests an implementation of a logger service. It uses the @@ -20,23 +20,23 @@ // // ============================================================================ - #include "ace/Get_Opt.h" #include "tao/corba.h" #include "orbsvcs/CosNamingC.h" #include "orbsvcs/LoggerC.h" class Logger_Client +{ // = TITLE - // Defines a class that encapsulates behaviour of the Logger client - // example. Provides a better understanding of the logic in an - // object oriented way. + // Defines a class that encapsulates behaviour of the Logger + // client example. Provides a better understanding of the logic + // in an object oriented way. // // = DESCRIPTION // This class declares an interface to run the example client for - // Logger CORBA server. All the complexity for initializing the - // server is hidden in the class. Just the run() interface is needed. -{ + // Logger CORBA server. All the complexity for initializing the + // server is hidden in the class. Just the run() interface is + // needed. public: // = Constructor and destructor. Logger_Client (void); diff --git a/TAO/orbsvcs/tests/Logger/svr.cpp b/TAO/orbsvcs/tests/Logger/server.cpp index 057a9d6b2f3..057a9d6b2f3 100644 --- a/TAO/orbsvcs/tests/Logger/svr.cpp +++ b/TAO/orbsvcs/tests/Logger/server.cpp diff --git a/docs/ACE-inheritance.pdf.gz b/docs/ACE-inheritance.pdf.gz Binary files differindex d4afff27ef1..e47b122e39d 100644 --- a/docs/ACE-inheritance.pdf.gz +++ b/docs/ACE-inheritance.pdf.gz diff --git a/docs/ACE-inheritance.ps.gz b/docs/ACE-inheritance.ps.gz Binary files differindex f487102d9cb..3aa19f4b62f 100644 --- a/docs/ACE-inheritance.ps.gz +++ b/docs/ACE-inheritance.ps.gz |