diff options
96 files changed, 2608 insertions, 1419 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index a6da39ec044..fd698584b2e 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,54 @@ +Sat Jul 31 12:07:48 1999 Douglas C. Schmidt <schmidt@mambo.cs.wustl.edu> + + * ace: Updated comments in all the header files so that references + to method names like ACE_Event_Handler::handle_input() were + changed to <ACE_Event_Handler::handle_input>. This change + enables the class2man scripts to use the appropriate "code" font + for these names in the auto-generated documentation. + + * ace/Asynch_IO_Impl: Moved the + virtual destructors for all the ACE_Asynch_*_Impl classes into + the *.cpp file, which is where they belong. + + * ace/Functor_T.h: Moved the destructor of ACE_Command_Callback + out of the header file and into the *.cpp file. + + * ace/Sched_Params.h: Updated the documentation a bit to mention + the ACE_SCHED_{FIFO,RR,OTHER} policies explicitly. Thanks to + Peter Mueller <pmueller@decrc.abb.de> for motivating this. + + * ace/Synch_T: Moved the implementations of ACE_Read_Guard and + ACE_Write_Guard out of the class header and into the *.i file, + which is where they belong. + + * ace/Based_Pointer_T.i (operator *): In order to distinquish a + "NULL" pointer we keep a value of -1 in target. + + * ace/Based_Pointer_T.i: I was forgetting to check if + rhs == 0 for the ACE_Based_Pointer<> class. This leads to weird + behavior when assigning a "NULL" pointer. + + * examples/Reactor/Misc/notification.cpp: Cleaned up the program so + that it looks better and doesn't crash and burn when signals occur. + + * ace/Pipe.cpp (open): We now set the default size of the + ACE_Pipes that are implemented as Internet or UNIX-domain + sockets to ACE_DEFAULT_MAX_SOCKET_BUFSIZ. This will speed up + the Reactor's notify() method and prevent it from deadlocking as + quickly. Thanks to Detlef Becker <Detlef.Becker@med.siemens.de> + for testing this out. + + * ace/OS.h: Added a new macro called ACE_IPPROTO_TCP that factors + out the differences between PHARLAPs and "normal" systems. + + * ace/Strategies_T.{i,cpp}: Added some additional ACE_ERROR printouts + if open() methods fail in constructors. + + * ace/Strategies_T: The logic for creating a new Singleton wasn't + dynamic enough. It's now intelligent enough to create a new + SVC_HANDLER if it's not given one. Thanks to Hao Ruan + <hruan@lucent.com> for reporting this. + Sat Jul 31 15:57:16 1999 coryan <coryan@cs.wustl.edu> * ACE version 5.0 released. @@ -27,8 +78,9 @@ Sat Jul 31 00:22:46 1999 Nanbor Wang <nanbor@cs.wustl.edu> Fri Jul 30 10:27:31 1999 Steve Huston <shuston@riverace.com> * ace/config-hpux-10.x.h: Allow building w/o threads - set _REENTRANT - if not set, to pick up _r functions; move ACE_HAS_NONCONST_SELECT_ - TIMEVAL out of the threads-only section. + if not set, to pick up _r functions; move + ACE_HAS_NONCONST_SELECT_ TIMEVAL out of the threads-only + section. Fri Jul 30 08:36:43 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index bf4ea52d9d0..d925c5946a7 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,14 @@ +Sat Jul 31 14:39:03 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * orbsvcs/Naming_Service: Added a program that enables the TAO + Naming Service to run as a Windows NT service. Thanks to John + Tucker <jtucker@infoglide.com> and Mike Vitalo + <mvitalo@infoglide.com> for contributing this. + + * tao/IIOP_Connect.cpp (open): Replaced the hard-coded + IPPROTO_TCP with ACE_IPPROTO_TCP to deal with differences + between PHARLAP and other platforms. + Sat Jul 31 16:02:49 1999 coryan <coryan@cs.wustl.edu> * TAO version 1.0 released. @@ -45,7 +56,7 @@ Fri Jul 30 18:47:34 1999 Carlos O'Ryan <coryan@cs.wustl.edu> * tao/IIOP_Connector.cpp: * tao/UIOP_Connector.cpp: If the connection fails then we have to reset the hint. We need - to re-examine the current solution, but after 1.0 + to re-examine the current solution, but after 1.0. Fri Jul 30 14:52:59 1999 Nanbor Wang <nanbor@cs.wustl.edu> @@ -56,12 +67,12 @@ Fri Jul 30 14:52:59 1999 Nanbor Wang <nanbor@cs.wustl.edu> Fri Jul 30 12:40:49 1999 Jeff Parsons <parsons@cs.wustl.edu> - * TAO/tests/IDL_Test/typedef.idl: - Commented out some code for now where an array contains - a typedef'd array. HP/UX-aCC had a problem with the - generated code, and the IDL compiler (as Carlos informs - me) does not include any of the config-* files, so we - have to comment this out for everybody. + * TAO/tests/IDL_Test/typedef.idl: + Commented out some code for now where an array contains + a typedef'd array. HP/UX-aCC had a problem with the + generated code, and the IDL compiler (as Carlos informs + me) does not include any of the config-* files, so we + have to comment this out for everybody. Fri Jul 30 11:08:38 1999 Carlos O'Ryan <coryan@cs.wustl.edu> diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Server.cpp b/TAO/orbsvcs/Naming_Service/NT_Naming_Server.cpp new file mode 100644 index 00000000000..b256d5153ee --- /dev/null +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Server.cpp @@ -0,0 +1,211 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// NT_Naming_Server.cpp +// +// +// = DESCRIPTION +// Driver program that runs the TAO Naming Service as a Windows NT +// Service. +// +// = AUTHORS +// John Tucker <jtucker@infoglide.com> and +// Mike Vitalo <mvitalo@infoglide.com> +// +// ============================================================================ + +#include "ace/OS.h" +#include "ace/Get_Opt.h" + +#include "winreg.h" +#include "NT_Naming_Service.h" + +// Default for the -i (install) option +#define DEFAULT_SERVICE_INIT_STARTUP SERVICE_DEMAND_START + +class Options +{ + // = TITLE + // Keeps track of the command-line options for this program. +public: + Options (void); + ~Options (void); + + int run (int argc, char *argv[]); + +private: + void parse_args (int argc, + char *argv[]); + void print_usage_and_die (void); + +private: + char progname[128]; + + int opt_install; + int opt_remove; + int opt_start; + int opt_kill; + int opt_type; + int opt_debug; + + int opt_startup; +}; + +typedef ACE_Singleton<Options, ACE_Mutex> OPTIONS; + +Options::Options (void) + : opt_install (0), + opt_remove (0), + opt_start (0), + opt_kill (0), + opt_type (0), + opt_debug (0), + opt_startup (0) +{ + ACE_OS::strcpy (progname, + "service"); + ACE::init (); +} + +Options::~Options (void) +{ + ACE::fini (); +} + +void +Options::print_usage_and_die (void) +{ + ACE_DEBUG ((LM_INFO, + "Usage: %s" + " -in -r -s -k -tn -d\n" + " -i: Install this program as an NT service, with specified startup\n" + " -r: Remove this program from the Service Manager\n" + " -s: Start the service\n" + " -k: Kill the service\n" + " -t: Set startup for an existing service\n" + " -d: Debug; run as a regular application\n", + progname, + 0)); + ACE_OS::exit (1); +} + +void +Options::parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opt (argc, argv, "i:rskt:d"); + int c; + + while ((c = get_opt ()) != -1) + switch (c) + { + case 'i': + opt_install = 1; + opt_startup = ACE_OS::atoi (get_opt.optarg); + if (opt_startup <= 0) + print_usage_and_die (); + break; + case 'r': + opt_remove = 1; + break; + case 's': + opt_start = 1; + break; + case 'k': + opt_kill = 1; + break; + case 't': + opt_type = 1; + opt_startup = ACE_OS::atoi (get_opt.optarg); + if (opt_startup <= 0) + print_usage_and_die (); + break; + case 'd': + //opt_debug = 1; + break; + default: + // -i can also be given without a value - if so, it defaults + // to defined value. + if (ACE_OS::strcmp (get_opt.argv_[get_opt.optind-1], "-i") == 0) + { + opt_install = 1; + opt_startup = DEFAULT_SERVICE_INIT_STARTUP; + } + else + this->print_usage_and_die (); + break; + } +} + +// Define a function to handle Ctrl+C to cleanly shut this down. + +static BOOL __stdcall +ConsoleHandler (DWORD ctrlType) +{ + SERVICE::instance ()->handle_control (SERVICE_CONTROL_STOP); + return TRUE; +} + +ACE_NT_SERVICE_DEFINE (service, + TAO_NT_Naming_Service, + "TAO NT Naming Service"); + +int +Options::run (int argc, char* argv[]) +{ + SERVICE::instance ()->name ("TAO_NT_Naming_Service", + "TAO NT Naming Service"); + + this->parse_args (argc, argv); + + if (opt_install && !opt_remove) + return SERVICE::instance ()->insert (opt_startup); + + if (opt_remove && !opt_install) + return SERVICE::instance ()->remove (); + + if (opt_start && opt_kill) + print_usage_and_die (); + + if (opt_start) + return SERVICE::instance ()->start_svc (); + + if (opt_kill) + return SERVICE::instance ()->stop_svc (); + + if (opt_type) + return SERVICE::instance ()->startup (opt_startup); + + // If we get here, we either run the app in debug mode (-d) or are + // being called from the service manager to start the service. + + if (opt_debug) + { + SetConsoleCtrlHandler (&ConsoleHandler, 1); + SERVICE::instance ()->svc (); + } + else + { + ACE_NT_SERVICE_RUN (service, + SERVICE::instance (), + ret); + if (ret == 0) + ACE_ERROR ((LM_ERROR, + "%p\n", + "Couldn't start service")); + } + + return 0; +} + +int +main (int argc, char *argv[]) +{ + return OPTIONS::instance ()->run (argc, argv); +} + diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp new file mode 100644 index 00000000000..ef3f0d23906 --- /dev/null +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp @@ -0,0 +1,75 @@ +/* -*- C++ -*- */ +// $Id$ + +#include /**/ "Naming_Service.h" +#include /**/ "NT_Naming_Service.h" + +TAO_NT_Naming_Service::TAO_NT_Naming_Service (void) + : argc_(0), + argv_(0) +{ +} + +TAO_NT_Naming_Service::~TAO_NT_Naming_Service (void) +{ +} + +void +TAO_NT_Naming_Service::handle_control (DWORD control_code) +{ + if (control_code == SERVICE_CONTROL_SHUTDOWN + || control_code == SERVICE_CONTROL_STOP) + { + report_status (SERVICE_STOP_PENDING); + TAO_ORB_Core_instance ()->reactor ()->end_event_loop (); + TAO_ORB_Core_instance ()->orb ()->shutdown (1); + report_status (SERVICE_STOPPED); + } + else + ACE_NT_Service::handle_control (control_code); +} + +int +TAO_NT_Naming_Service::handle_exception (ACE_HANDLE) +{ + return 0; +} + +int +TAO_NT_Naming_Service::init (int argc, + ASYS_TCHAR *argv[]) +{ + argc_ = argc; + argv_ = argv; + + return 0; +} + +int +TAO_NT_Naming_Service::svc (void) +{ + TAO_Naming_Service naming_service; + + if (naming_service.init (argc_, + argv_) == -1) + return -1; + + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + report_status (SERVICE_RUNNING); + naming_service.run (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "TAO NT Naming Service"); + return -1; + } + ACE_ENDTRY; + ACE_CHECK_RETURN (1); + + return 0; +} + diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.dsp b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.dsp new file mode 100644 index 00000000000..43b0a4711ed --- /dev/null +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.dsp @@ -0,0 +1,471 @@ +# Microsoft Developer Studio Project File - Name="NT_Naming_Service" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 +# TARGTYPE "Win32 (ALPHA) Console Application" 0x0603 + +CFG=NT_Naming_Service - Win32 Alpha Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "NT_Naming_Service.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "NT_Naming_Service.mak" CFG="NT_Naming_Service - Win32 Alpha Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "NT_Naming_Service - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "NT_Naming_Service - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "NT_Naming_Service - Win32 Alpha Debug" (based on "Win32 (ALPHA) Console Application") +!MESSAGE "NT_Naming_Service - Win32 Alpha Release" (based on "Win32 (ALPHA) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "NT_Naming_Service - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 orbsvcs.lib TAO.lib ace.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 TAOd.lib orbsvcsd.lib aced.lib user32.lib advapi32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Naming_S" +# PROP BASE Intermediate_Dir "Naming_S" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /MDd /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 TAOd.lib orbsvcsd.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:ALPHA /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" +# ADD LINK32 TAOd.lib orbsvcsd.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:ALPHA /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Naming_0" +# PROP BASE Intermediate_Dir "Naming_0" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /Gt0 /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 orbsvcs.lib TAO.lib ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:ALPHA /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" +# ADD LINK32 orbsvcs.lib TAO.lib ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:ALPHA /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ENDIF + +# Begin Target + +# Name "NT_Naming_Service - Win32 Release" +# Name "NT_Naming_Service - Win32 Debug" +# Name "NT_Naming_Service - Win32 Alpha Debug" +# Name "NT_Naming_Service - Win32 Alpha Release" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Naming_Service.cpp + +!IF "$(CFG)" == "NT_Naming_Service - Win32 Release" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Debug" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Debug" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\NT_Naming_Server.cpp + +!IF "$(CFG)" == "NT_Naming_Service - Win32 Release" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Debug" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Debug" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\NT_Naming_Service.cpp + +!IF "$(CFG)" == "NT_Naming_Service - Win32 Release" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Debug" + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Debug" + +DEP_CPP_NT_NA=\ + "..\..\..\ace\Acceptor.cpp"\ + "..\..\..\ace\Acceptor.h"\ + "..\..\..\ace\Acceptor.i"\ + "..\..\..\ace\ACE.h"\ + "..\..\..\ace\ACE.i"\ + "..\..\..\ace\Addr.h"\ + "..\..\..\ace\Addr.i"\ + "..\..\..\ace\Atomic_Op.i"\ + "..\..\..\ace\Auto_Ptr.cpp"\ + "..\..\..\ace\Auto_Ptr.h"\ + "..\..\..\ace\Auto_Ptr.i"\ + "..\..\..\ace\Basic_Types.h"\ + "..\..\..\ace\Basic_Types.i"\ + "..\..\..\ace\config-win32-borland.h"\ + "..\..\..\ace\config-win32-common.h"\ + "..\..\..\ace\config-win32.h"\ + "..\..\..\ace\config-WinCE.h"\ + "..\..\..\ace\config.h"\ + "..\..\..\ace\Connector.cpp"\ + "..\..\..\ace\Connector.h"\ + "..\..\..\ace\Connector.i"\ + "..\..\..\ace\Containers.cpp"\ + "..\..\..\ace\Containers.h"\ + "..\..\..\ace\Containers.i"\ + "..\..\..\ace\Dynamic.h"\ + "..\..\..\ace\Dynamic.i"\ + "..\..\..\ace\Dynamic_Service.cpp"\ + "..\..\..\ace\Dynamic_Service.h"\ + "..\..\..\ace\Event_Handler.h"\ + "..\..\..\ace\Event_Handler.i"\ + "..\..\..\ace\Free_List.cpp"\ + "..\..\..\ace\Free_List.h"\ + "..\..\..\ace\Free_List.i"\ + "..\..\..\ace\Get_Opt.h"\ + "..\..\..\ace\Get_Opt.i"\ + "..\..\..\ace\Handle_Set.h"\ + "..\..\..\ace\Handle_Set.i"\ + "..\..\..\ace\Hash_Map_Manager.cpp"\ + "..\..\..\ace\Hash_Map_Manager.h"\ + "..\..\..\ace\inc_user_config.h"\ + "..\..\..\ace\INET_Addr.h"\ + "..\..\..\ace\INET_Addr.i"\ + "..\..\..\ace\IO_Cntl_Msg.h"\ + "..\..\..\ace\iosfwd.h"\ + "..\..\..\ace\IPC_SAP.h"\ + "..\..\..\ace\IPC_SAP.i"\ + "..\..\..\ace\Log_Msg.h"\ + "..\..\..\ace\Log_Priority.h"\ + "..\..\..\ace\Log_Record.h"\ + "..\..\..\ace\Log_Record.i"\ + "..\..\..\ace\Malloc.h"\ + "..\..\..\ace\Malloc.i"\ + "..\..\..\ace\Malloc_Base.h"\ + "..\..\..\ace\Malloc_T.cpp"\ + "..\..\..\ace\Malloc_T.h"\ + "..\..\..\ace\Malloc_T.i"\ + "..\..\..\ace\Managed_Object.cpp"\ + "..\..\..\ace\Managed_Object.h"\ + "..\..\..\ace\Managed_Object.i"\ + "..\..\..\ace\Map_Manager.cpp"\ + "..\..\..\ace\Map_Manager.h"\ + "..\..\..\ace\Map_Manager.i"\ + "..\..\..\ace\Mem_Map.h"\ + "..\..\..\ace\Mem_Map.i"\ + "..\..\..\ace\Memory_Pool.h"\ + "..\..\..\ace\Memory_Pool.i"\ + "..\..\..\ace\Message_Block.h"\ + "..\..\..\ace\Message_Block.i"\ + "..\..\..\ace\Message_Queue.h"\ + "..\..\..\ace\Message_Queue.i"\ + "..\..\..\ace\Message_Queue_T.cpp"\ + "..\..\..\ace\Message_Queue_T.h"\ + "..\..\..\ace\Message_Queue_T.i"\ + "..\..\..\ace\Module.cpp"\ + "..\..\..\ace\Module.h"\ + "..\..\..\ace\Module.i"\ + "..\..\..\ace\Object_Manager.h"\ + "..\..\..\ace\Object_Manager.i"\ + "..\..\..\ace\OS.h"\ + "..\..\..\ace\OS.i"\ + "..\..\..\ace\Reactor.h"\ + "..\..\..\ace\Reactor.i"\ + "..\..\..\ace\Reactor_Impl.h"\ + "..\..\..\ace\Service_Config.h"\ + "..\..\..\ace\Service_Config.i"\ + "..\..\..\ace\Service_Object.h"\ + "..\..\..\ace\Service_Object.i"\ + "..\..\..\ace\Service_Repository.h"\ + "..\..\..\ace\Service_Repository.i"\ + "..\..\..\ace\Service_Types.h"\ + "..\..\..\ace\Service_Types.i"\ + "..\..\..\ace\Shared_Object.h"\ + "..\..\..\ace\Shared_Object.i"\ + "..\..\..\ace\Signal.h"\ + "..\..\..\ace\Signal.i"\ + "..\..\..\ace\Singleton.cpp"\ + "..\..\..\ace\Singleton.h"\ + "..\..\..\ace\Singleton.i"\ + "..\..\..\ace\SOCK.h"\ + "..\..\..\ace\SOCK.i"\ + "..\..\..\ace\SOCK_Acceptor.h"\ + "..\..\..\ace\SOCK_Acceptor.i"\ + "..\..\..\ace\SOCK_Connector.h"\ + "..\..\..\ace\SOCK_Connector.i"\ + "..\..\..\ace\SOCK_Dgram.h"\ + "..\..\..\ace\SOCK_Dgram.i"\ + "..\..\..\ace\SOCK_Dgram_Mcast.h"\ + "..\..\..\ace\SOCK_Dgram_Mcast.i"\ + "..\..\..\ace\SOCK_IO.h"\ + "..\..\..\ace\SOCK_IO.i"\ + "..\..\..\ace\SOCK_Stream.h"\ + "..\..\..\ace\SOCK_Stream.i"\ + "..\..\..\ace\SString.h"\ + "..\..\..\ace\SString.i"\ + "..\..\..\ace\Strategies.h"\ + "..\..\..\ace\Strategies.i"\ + "..\..\..\ace\Strategies_T.cpp"\ + "..\..\..\ace\Strategies_T.h"\ + "..\..\..\ace\Strategies_T.i"\ + "..\..\..\ace\Stream_Modules.cpp"\ + "..\..\..\ace\Stream_Modules.h"\ + "..\..\..\ace\Stream_Modules.i"\ + "..\..\..\ace\streams.h"\ + "..\..\..\ace\SV_Semaphore_Complex.h"\ + "..\..\..\ace\SV_Semaphore_Complex.i"\ + "..\..\..\ace\SV_Semaphore_Simple.h"\ + "..\..\..\ace\SV_Semaphore_Simple.i"\ + "..\..\..\ace\Svc_Conf_Tokens.h"\ + "..\..\..\ace\Svc_Handler.cpp"\ + "..\..\..\ace\Svc_Handler.h"\ + "..\..\..\ace\Svc_Handler.i"\ + "..\..\..\ace\Synch.h"\ + "..\..\..\ace\Synch.i"\ + "..\..\..\ace\Synch_Options.h"\ + "..\..\..\ace\Synch_Options.i"\ + "..\..\..\ace\Synch_T.cpp"\ + "..\..\..\ace\Synch_T.h"\ + "..\..\..\ace\Synch_T.i"\ + "..\..\..\ace\Task.h"\ + "..\..\..\ace\Task.i"\ + "..\..\..\ace\Task_T.cpp"\ + "..\..\..\ace\Task_T.h"\ + "..\..\..\ace\Task_T.i"\ + "..\..\..\ace\Thread.h"\ + "..\..\..\ace\Thread.i"\ + "..\..\..\ace\Thread_Manager.h"\ + "..\..\..\ace\Thread_Manager.i"\ + "..\..\..\ace\Time_Value.h"\ + "..\..\..\ace\Timer_Queue.h"\ + "..\..\..\ace\Timer_Queue_T.cpp"\ + "..\..\..\ace\Timer_Queue_T.h"\ + "..\..\..\ace\Timer_Queue_T.i"\ + "..\..\..\ace\Trace.h"\ + "..\..\..\ace\WFMO_Reactor.h"\ + "..\..\..\ace\WFMO_Reactor.i"\ + "..\..\..\ace\ws2tcpip.h"\ + "..\..\tao\any.h"\ + "..\..\tao\any.i"\ + "..\..\tao\cdr.h"\ + "..\..\tao\cdr.i"\ + "..\..\tao\CDR_Interpreter.h"\ + "..\..\tao\Client_Strategy_Factory.h"\ + "..\..\tao\corba.h"\ + "..\..\tao\CurrentC.h"\ + "..\..\tao\CurrentC.i"\ + "..\..\tao\debug.h"\ + "..\..\tao\default_client.h"\ + "..\..\tao\default_client.i"\ + "..\..\tao\default_server.h"\ + "..\..\tao\default_server.i"\ + "..\..\tao\Environment.h"\ + "..\..\tao\Environment.i"\ + "..\..\tao\Exception.h"\ + "..\..\tao\Exception.i"\ + "..\..\tao\giop.h"\ + "..\..\tao\giop.i"\ + "..\..\tao\Invocation.h"\ + "..\..\tao\Invocation.i"\ + "..\..\tao\marshal.h"\ + "..\..\tao\marshal.i"\ + "..\..\tao\nvlist.h"\ + "..\..\tao\NVList.i"\ + "..\..\tao\object.h"\ + "..\..\tao\object.i"\ + "..\..\tao\Object_KeyC.h"\ + "..\..\tao\Object_KeyC.i"\ + "..\..\tao\Operation_Table.h"\ + "..\..\tao\orb.h"\ + "..\..\tao\ORB.i"\ + "..\..\tao\orb_core.h"\ + "..\..\tao\orb_core.i"\ + "..\..\tao\orbconf.h"\ + "..\..\tao\params.h"\ + "..\..\tao\params.i"\ + "..\..\tao\poa.h"\ + "..\..\tao\POA.i"\ + "..\..\tao\POA_CORBA.h"\ + "..\..\tao\poa_macros.h"\ + "..\..\tao\poaC.h"\ + "..\..\tao\poaC.i"\ + "..\..\tao\poaS.h"\ + "..\..\tao\poaS.i"\ + "..\..\tao\PolicyC.h"\ + "..\..\tao\PolicyC.i"\ + "..\..\tao\Principal.h"\ + "..\..\tao\Principal.i"\ + "..\..\tao\request.h"\ + "..\..\tao\Request.i"\ + "..\..\tao\sequence.h"\ + "..\..\tao\sequence.i"\ + "..\..\tao\Sequence_T.cpp"\ + "..\..\tao\Sequence_T.h"\ + "..\..\tao\Sequence_T.i"\ + "..\..\tao\servant_base.h"\ + "..\..\tao\Server_Request.h"\ + "..\..\tao\Server_Request.i"\ + "..\..\tao\Server_Strategy_Factory.h"\ + "..\..\tao\singletons.h"\ + "..\..\tao\stub.h"\ + "..\..\tao\stub.i"\ + "..\..\tao\TAO.h"\ + "..\..\tao\typecode.h"\ + "..\..\tao\typecode.i"\ + "..\..\tao\Union.h"\ + "..\..\tao\varout.cpp"\ + "..\..\tao\varout.h"\ + "..\..\tao\varout.i"\ + "..\orbsvcs\CosNamingC.h"\ + "..\orbsvcs\CosNamingC.i"\ + "..\orbsvcs\CosNamingS.h"\ + "..\orbsvcs\CosNamingS.i"\ + "..\orbsvcs\CosNamingS_T.cpp"\ + "..\orbsvcs\CosNamingS_T.h"\ + "..\orbsvcs\CosNamingS_T.i"\ + "..\orbsvcs\IOR_Multicast.h"\ + "..\orbsvcs\Naming\Entries.h"\ + "..\orbsvcs\Naming\Naming_Utils.h"\ + "..\orbsvcs\orbsvcs_export.h"\ + ".\NT_Naming_Service.h"\ + +NODEP_CPP_NT_NA=\ + "..\..\..\ace\sys_conf.h"\ + "..\..\tao\align.h"\ + "..\..\tao\connect.h"\ + "..\..\tao\connect.i"\ + "..\..\tao\IIOP_Object.h"\ + "..\..\tao\IIOP_Object.i"\ + "..\..\tao\IIOP_ORB.h"\ + "..\..\tao\IIOP_ORB.i"\ + "..\..\tao\Object_Table.h"\ + "..\..\tao\ORB_Strategies_T.cpp"\ + "..\..\tao\ORB_Strategies_T.h"\ + "..\..\tao\ORB_Strategies_T.i"\ + "..\orbsvcs\Naming\CosNaming_i.h"\ + + +!ELSEIF "$(CFG)" == "NT_Naming_Service - Win32 Alpha Release" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Naming_Service.h +# End Source File +# Begin Source File + +SOURCE=.\NT_Naming_Service.h +# End Source File +# End Group +# End Target +# End Project diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h new file mode 100644 index 00000000000..a0440c9de80 --- /dev/null +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h @@ -0,0 +1,68 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// NT_Naming_Service.h +// +// +// = DESCRIPTION +// Run the TAO Naming Service as a Windows NT Service. +// +// = AUTHORS +// John Tucker <jtucker@infoglide.com> and +// Mike Vitalo <mvitalo@infoglide.com> +// +// ============================================================================ + +#ifndef TAO_NT_NAMING_SERVICE_H +#define TAO_NT_NAMING_SERVICE_H + +#include /**/ "ace/OS.h" +#include /**/ "ace/NT_Service.h" +#include /**/ "ace/Singleton.h" +#include /**/ "ace/Synch.h" + +class TAO_NT_Naming_Service : public ACE_NT_Service +{ + // = TITLE + // Run the TAO Naming Service as a Windows NT Service. +public: + typedef ACE_Recursive_Thread_Mutex MUTEX; + + // = Initialization and termination hooks. + TAO_NT_Naming_Service (void); + virtual ~TAO_NT_Naming_Service (void); + + virtual void handle_control (DWORD control_code); + // We override <handle_control> because it handles stop requests + // privately. + + virtual int handle_exception (ACE_HANDLE h); + // We override <handle_exception> so a 'stop' control code can pop + // the reactor off of its wait. + + virtual int svc (void); + // This is a virtual method inherited from ACE_NT_Service. + + virtual int init (int argc, + ASYS_TCHAR *argv[]); + // Initialize the objects argc_ and argv_ attributes values. + +private: + // Keep track of the "command-line" arguments. + int argc_; + char **argv_; + + friend class ACE_Singleton<TAO_NT_Naming_Service, MUTEX>; +}; + +typedef ACE_Singleton<TAO_NT_Naming_Service, ACE_Mutex> SERVICE; + +#endif /* TAO_NT_NAMING_SERVER_H */ + + diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.dsp b/TAO/orbsvcs/Naming_Service/Naming_Service.dsp index f39619017ec..638cb03ab2b 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.dsp +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.dsp @@ -1,460 +1,460 @@ -# Microsoft Developer Studio Project File - Name="Naming_Service" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-# TARGTYPE "Win32 (ALPHA) Console Application" 0x0603
-
-CFG=Naming_Service - Win32 Alpha Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Naming_Service.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Naming_Service.mak" CFG="Naming_Service - Win32 Alpha Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Naming_Service - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "Naming_Service - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "Naming_Service - Win32 Alpha Debug" (based on "Win32 (ALPHA) Console Application")
-!MESSAGE "Naming_Service - Win32 Alpha Release" (based on "Win32 (ALPHA) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-
-!IF "$(CFG)" == "Naming_Service - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c
-# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 orbsvcs.lib TAO.lib ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c
-# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 TAOd.lib orbsvcsd.lib aced.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Naming_S"
-# PROP BASE Intermediate_Dir "Naming_S"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /MDd /c
-# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 TAOd.lib orbsvcsd.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:ALPHA /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-# ADD LINK32 TAOd.lib orbsvcsd.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:ALPHA /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Naming_0"
-# PROP BASE Intermediate_Dir "Naming_0"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c
-# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 orbsvcs.lib TAO.lib ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:ALPHA /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-# ADD LINK32 orbsvcs.lib TAO.lib ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:ALPHA /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "Naming_Service - Win32 Release"
-# Name "Naming_Service - Win32 Debug"
-# Name "Naming_Service - Win32 Alpha Debug"
-# Name "Naming_Service - Win32 Alpha Release"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\Naming_Server.cpp
-
-!IF "$(CFG)" == "Naming_Service - Win32 Release"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Debug"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Release"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\Naming_Service.cpp
-
-!IF "$(CFG)" == "Naming_Service - Win32 Release"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Debug"
-
-DEP_CPP_NAMIN=\
- "..\..\..\ace\Acceptor.cpp"\
- "..\..\..\ace\Acceptor.h"\
- "..\..\..\ace\Acceptor.i"\
- "..\..\..\ace\ACE.h"\
- "..\..\..\ace\ACE.i"\
- "..\..\..\ace\Addr.h"\
- "..\..\..\ace\Addr.i"\
- "..\..\..\ace\Atomic_Op.i"\
- "..\..\..\ace\Auto_Ptr.cpp"\
- "..\..\..\ace\Auto_Ptr.h"\
- "..\..\..\ace\Auto_Ptr.i"\
- "..\..\..\ace\Basic_Types.h"\
- "..\..\..\ace\Basic_Types.i"\
- "..\..\..\ace\config-win32-borland.h"\
- "..\..\..\ace\config-win32-common.h"\
- "..\..\..\ace\config-win32.h"\
- "..\..\..\ace\config-WinCE.h"\
- "..\..\..\ace\config.h"\
- "..\..\..\ace\Connector.cpp"\
- "..\..\..\ace\Connector.h"\
- "..\..\..\ace\Connector.i"\
- "..\..\..\ace\Containers.cpp"\
- "..\..\..\ace\Containers.h"\
- "..\..\..\ace\Containers.i"\
- "..\..\..\ace\Dynamic.h"\
- "..\..\..\ace\Dynamic.i"\
- "..\..\..\ace\Dynamic_Service.cpp"\
- "..\..\..\ace\Dynamic_Service.h"\
- "..\..\..\ace\Event_Handler.h"\
- "..\..\..\ace\Event_Handler.i"\
- "..\..\..\ace\Free_List.cpp"\
- "..\..\..\ace\Free_List.h"\
- "..\..\..\ace\Free_List.i"\
- "..\..\..\ace\Get_Opt.h"\
- "..\..\..\ace\Get_Opt.i"\
- "..\..\..\ace\Handle_Set.h"\
- "..\..\..\ace\Handle_Set.i"\
- "..\..\..\ace\Hash_Map_Manager.cpp"\
- "..\..\..\ace\Hash_Map_Manager.h"\
- "..\..\..\ace\inc_user_config.h"\
- "..\..\..\ace\INET_Addr.h"\
- "..\..\..\ace\INET_Addr.i"\
- "..\..\..\ace\IO_Cntl_Msg.h"\
- "..\..\..\ace\iosfwd.h"\
- "..\..\..\ace\IPC_SAP.h"\
- "..\..\..\ace\IPC_SAP.i"\
- "..\..\..\ace\Log_Msg.h"\
- "..\..\..\ace\Log_Priority.h"\
- "..\..\..\ace\Log_Record.h"\
- "..\..\..\ace\Log_Record.i"\
- "..\..\..\ace\Malloc.h"\
- "..\..\..\ace\Malloc.i"\
- "..\..\..\ace\Malloc_Base.h"\
- "..\..\..\ace\Malloc_T.cpp"\
- "..\..\..\ace\Malloc_T.h"\
- "..\..\..\ace\Malloc_T.i"\
- "..\..\..\ace\Managed_Object.cpp"\
- "..\..\..\ace\Managed_Object.h"\
- "..\..\..\ace\Managed_Object.i"\
- "..\..\..\ace\Map_Manager.cpp"\
- "..\..\..\ace\Map_Manager.h"\
- "..\..\..\ace\Map_Manager.i"\
- "..\..\..\ace\Mem_Map.h"\
- "..\..\..\ace\Mem_Map.i"\
- "..\..\..\ace\Memory_Pool.h"\
- "..\..\..\ace\Memory_Pool.i"\
- "..\..\..\ace\Message_Block.h"\
- "..\..\..\ace\Message_Block.i"\
- "..\..\..\ace\Message_Queue.h"\
- "..\..\..\ace\Message_Queue.i"\
- "..\..\..\ace\Message_Queue_T.cpp"\
- "..\..\..\ace\Message_Queue_T.h"\
- "..\..\..\ace\Message_Queue_T.i"\
- "..\..\..\ace\Module.cpp"\
- "..\..\..\ace\Module.h"\
- "..\..\..\ace\Module.i"\
- "..\..\..\ace\Object_Manager.h"\
- "..\..\..\ace\Object_Manager.i"\
- "..\..\..\ace\OS.h"\
- "..\..\..\ace\OS.i"\
- "..\..\..\ace\Reactor.h"\
- "..\..\..\ace\Reactor.i"\
- "..\..\..\ace\Reactor_Impl.h"\
- "..\..\..\ace\Service_Config.h"\
- "..\..\..\ace\Service_Config.i"\
- "..\..\..\ace\Service_Object.h"\
- "..\..\..\ace\Service_Object.i"\
- "..\..\..\ace\Service_Repository.h"\
- "..\..\..\ace\Service_Repository.i"\
- "..\..\..\ace\Service_Types.h"\
- "..\..\..\ace\Service_Types.i"\
- "..\..\..\ace\Shared_Object.h"\
- "..\..\..\ace\Shared_Object.i"\
- "..\..\..\ace\Signal.h"\
- "..\..\..\ace\Signal.i"\
- "..\..\..\ace\Singleton.cpp"\
- "..\..\..\ace\Singleton.h"\
- "..\..\..\ace\Singleton.i"\
- "..\..\..\ace\SOCK.h"\
- "..\..\..\ace\SOCK.i"\
- "..\..\..\ace\SOCK_Acceptor.h"\
- "..\..\..\ace\SOCK_Acceptor.i"\
- "..\..\..\ace\SOCK_Connector.h"\
- "..\..\..\ace\SOCK_Connector.i"\
- "..\..\..\ace\SOCK_Dgram.h"\
- "..\..\..\ace\SOCK_Dgram.i"\
- "..\..\..\ace\SOCK_Dgram_Mcast.h"\
- "..\..\..\ace\SOCK_Dgram_Mcast.i"\
- "..\..\..\ace\SOCK_IO.h"\
- "..\..\..\ace\SOCK_IO.i"\
- "..\..\..\ace\SOCK_Stream.h"\
- "..\..\..\ace\SOCK_Stream.i"\
- "..\..\..\ace\SString.h"\
- "..\..\..\ace\SString.i"\
- "..\..\..\ace\Strategies.h"\
- "..\..\..\ace\Strategies.i"\
- "..\..\..\ace\Strategies_T.cpp"\
- "..\..\..\ace\Strategies_T.h"\
- "..\..\..\ace\Strategies_T.i"\
- "..\..\..\ace\Stream_Modules.cpp"\
- "..\..\..\ace\Stream_Modules.h"\
- "..\..\..\ace\Stream_Modules.i"\
- "..\..\..\ace\streams.h"\
- "..\..\..\ace\SV_Semaphore_Complex.h"\
- "..\..\..\ace\SV_Semaphore_Complex.i"\
- "..\..\..\ace\SV_Semaphore_Simple.h"\
- "..\..\..\ace\SV_Semaphore_Simple.i"\
- "..\..\..\ace\Svc_Conf_Tokens.h"\
- "..\..\..\ace\Svc_Handler.cpp"\
- "..\..\..\ace\Svc_Handler.h"\
- "..\..\..\ace\Svc_Handler.i"\
- "..\..\..\ace\Synch.h"\
- "..\..\..\ace\Synch.i"\
- "..\..\..\ace\Synch_Options.h"\
- "..\..\..\ace\Synch_Options.i"\
- "..\..\..\ace\Synch_T.cpp"\
- "..\..\..\ace\Synch_T.h"\
- "..\..\..\ace\Synch_T.i"\
- "..\..\..\ace\Task.h"\
- "..\..\..\ace\Task.i"\
- "..\..\..\ace\Task_T.cpp"\
- "..\..\..\ace\Task_T.h"\
- "..\..\..\ace\Task_T.i"\
- "..\..\..\ace\Thread.h"\
- "..\..\..\ace\Thread.i"\
- "..\..\..\ace\Thread_Manager.h"\
- "..\..\..\ace\Thread_Manager.i"\
- "..\..\..\ace\Time_Value.h"\
- "..\..\..\ace\Timer_Queue.h"\
- "..\..\..\ace\Timer_Queue_T.cpp"\
- "..\..\..\ace\Timer_Queue_T.h"\
- "..\..\..\ace\Timer_Queue_T.i"\
- "..\..\..\ace\Trace.h"\
- "..\..\..\ace\WFMO_Reactor.h"\
- "..\..\..\ace\WFMO_Reactor.i"\
- "..\..\..\ace\ws2tcpip.h"\
- "..\..\tao\any.h"\
- "..\..\tao\any.i"\
- "..\..\tao\cdr.h"\
- "..\..\tao\cdr.i"\
- "..\..\tao\CDR_Interpreter.h"\
- "..\..\tao\Client_Strategy_Factory.h"\
- "..\..\tao\corba.h"\
- "..\..\tao\CurrentC.h"\
- "..\..\tao\CurrentC.i"\
- "..\..\tao\debug.h"\
- "..\..\tao\default_client.h"\
- "..\..\tao\default_client.i"\
- "..\..\tao\default_server.h"\
- "..\..\tao\default_server.i"\
- "..\..\tao\Environment.h"\
- "..\..\tao\Environment.i"\
- "..\..\tao\Exception.h"\
- "..\..\tao\Exception.i"\
- "..\..\tao\giop.h"\
- "..\..\tao\giop.i"\
- "..\..\tao\Invocation.h"\
- "..\..\tao\Invocation.i"\
- "..\..\tao\marshal.h"\
- "..\..\tao\marshal.i"\
- "..\..\tao\nvlist.h"\
- "..\..\tao\NVList.i"\
- "..\..\tao\object.h"\
- "..\..\tao\object.i"\
- "..\..\tao\Object_KeyC.h"\
- "..\..\tao\Object_KeyC.i"\
- "..\..\tao\Operation_Table.h"\
- "..\..\tao\orb.h"\
- "..\..\tao\ORB.i"\
- "..\..\tao\orb_core.h"\
- "..\..\tao\orb_core.i"\
- "..\..\tao\orbconf.h"\
- "..\..\tao\params.h"\
- "..\..\tao\params.i"\
- "..\..\tao\poa.h"\
- "..\..\tao\POA.i"\
- "..\..\tao\POA_CORBA.h"\
- "..\..\tao\poa_macros.h"\
- "..\..\tao\poaC.h"\
- "..\..\tao\poaC.i"\
- "..\..\tao\poaS.h"\
- "..\..\tao\poaS.i"\
- "..\..\tao\PolicyC.h"\
- "..\..\tao\PolicyC.i"\
- "..\..\tao\Principal.h"\
- "..\..\tao\Principal.i"\
- "..\..\tao\request.h"\
- "..\..\tao\Request.i"\
- "..\..\tao\sequence.h"\
- "..\..\tao\sequence.i"\
- "..\..\tao\Sequence_T.cpp"\
- "..\..\tao\Sequence_T.h"\
- "..\..\tao\Sequence_T.i"\
- "..\..\tao\servant_base.h"\
- "..\..\tao\Server_Request.h"\
- "..\..\tao\Server_Request.i"\
- "..\..\tao\Server_Strategy_Factory.h"\
- "..\..\tao\singletons.h"\
- "..\..\tao\stub.h"\
- "..\..\tao\stub.i"\
- "..\..\tao\TAO.h"\
- "..\..\tao\typecode.h"\
- "..\..\tao\typecode.i"\
- "..\..\tao\Union.h"\
- "..\..\tao\varout.cpp"\
- "..\..\tao\varout.h"\
- "..\..\tao\varout.i"\
- "..\orbsvcs\CosNamingC.h"\
- "..\orbsvcs\CosNamingC.i"\
- "..\orbsvcs\CosNamingS.h"\
- "..\orbsvcs\CosNamingS.i"\
- "..\orbsvcs\CosNamingS_T.cpp"\
- "..\orbsvcs\CosNamingS_T.h"\
- "..\orbsvcs\CosNamingS_T.i"\
- "..\orbsvcs\IOR_Multicast.h"\
- "..\orbsvcs\Naming\Entries.h"\
- "..\orbsvcs\Naming\Naming_Utils.h"\
- "..\orbsvcs\orbsvcs_export.h"\
- ".\Naming_Service.h"\
-
-NODEP_CPP_NAMIN=\
- "..\..\..\ace\sys_conf.h"\
- "..\..\tao\align.h"\
- "..\..\tao\connect.h"\
- "..\..\tao\connect.i"\
- "..\..\tao\IIOP_Object.h"\
- "..\..\tao\IIOP_Object.i"\
- "..\..\tao\IIOP_ORB.h"\
- "..\..\tao\IIOP_ORB.i"\
- "..\..\tao\Object_Table.h"\
- "..\..\tao\ORB_Strategies_T.cpp"\
- "..\..\tao\ORB_Strategies_T.h"\
- "..\..\tao\ORB_Strategies_T.i"\
- "..\orbsvcs\Naming\CosNaming_i.h"\
-
-
-!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Release"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\CosNaming_i.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Naming_Service.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\NS_CosNaming.h
-# End Source File
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="Naming_Service" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 +# TARGTYPE "Win32 (ALPHA) Console Application" 0x0603 + +CFG=Naming_Service - Win32 Alpha Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Naming_Service.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Naming_Service.mak" CFG="Naming_Service - Win32 Alpha Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Naming_Service - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "Naming_Service - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "Naming_Service - Win32 Alpha Debug" (based on "Win32 (ALPHA) Console Application") +!MESSAGE "Naming_Service - Win32 Alpha Release" (based on "Win32 (ALPHA) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "Naming_Service - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 orbsvcs.lib TAO.lib ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 TAOd.lib orbsvcsd.lib aced.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Naming_S" +# PROP BASE Intermediate_Dir "Naming_S" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /MDd /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 TAOd.lib orbsvcsd.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:ALPHA /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" +# ADD LINK32 TAOd.lib orbsvcsd.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:ALPHA /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Naming_0" +# PROP BASE Intermediate_Dir "Naming_0" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /Gt0 /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /I ".." /I "..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D TAO_ORBSVCS_HAS_DLL=1 /FD /c +# SUBTRACT CPP /YX +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 orbsvcs.lib TAO.lib ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:ALPHA /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" +# ADD LINK32 orbsvcs.lib TAO.lib ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:ALPHA /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace" + +!ENDIF + +# Begin Target + +# Name "Naming_Service - Win32 Release" +# Name "Naming_Service - Win32 Debug" +# Name "Naming_Service - Win32 Alpha Debug" +# Name "Naming_Service - Win32 Alpha Release" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Naming_Server.cpp + +!IF "$(CFG)" == "Naming_Service - Win32 Release" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Debug" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Debug" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Naming_Service.cpp + +!IF "$(CFG)" == "Naming_Service - Win32 Release" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Debug" + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Debug" + +DEP_CPP_NAMIN=\ + "..\..\..\ace\Acceptor.cpp"\ + "..\..\..\ace\Acceptor.h"\ + "..\..\..\ace\Acceptor.i"\ + "..\..\..\ace\ACE.h"\ + "..\..\..\ace\ACE.i"\ + "..\..\..\ace\Addr.h"\ + "..\..\..\ace\Addr.i"\ + "..\..\..\ace\Atomic_Op.i"\ + "..\..\..\ace\Auto_Ptr.cpp"\ + "..\..\..\ace\Auto_Ptr.h"\ + "..\..\..\ace\Auto_Ptr.i"\ + "..\..\..\ace\Basic_Types.h"\ + "..\..\..\ace\Basic_Types.i"\ + "..\..\..\ace\config-win32-borland.h"\ + "..\..\..\ace\config-win32-common.h"\ + "..\..\..\ace\config-win32.h"\ + "..\..\..\ace\config-WinCE.h"\ + "..\..\..\ace\config.h"\ + "..\..\..\ace\Connector.cpp"\ + "..\..\..\ace\Connector.h"\ + "..\..\..\ace\Connector.i"\ + "..\..\..\ace\Containers.cpp"\ + "..\..\..\ace\Containers.h"\ + "..\..\..\ace\Containers.i"\ + "..\..\..\ace\Dynamic.h"\ + "..\..\..\ace\Dynamic.i"\ + "..\..\..\ace\Dynamic_Service.cpp"\ + "..\..\..\ace\Dynamic_Service.h"\ + "..\..\..\ace\Event_Handler.h"\ + "..\..\..\ace\Event_Handler.i"\ + "..\..\..\ace\Free_List.cpp"\ + "..\..\..\ace\Free_List.h"\ + "..\..\..\ace\Free_List.i"\ + "..\..\..\ace\Get_Opt.h"\ + "..\..\..\ace\Get_Opt.i"\ + "..\..\..\ace\Handle_Set.h"\ + "..\..\..\ace\Handle_Set.i"\ + "..\..\..\ace\Hash_Map_Manager.cpp"\ + "..\..\..\ace\Hash_Map_Manager.h"\ + "..\..\..\ace\inc_user_config.h"\ + "..\..\..\ace\INET_Addr.h"\ + "..\..\..\ace\INET_Addr.i"\ + "..\..\..\ace\IO_Cntl_Msg.h"\ + "..\..\..\ace\iosfwd.h"\ + "..\..\..\ace\IPC_SAP.h"\ + "..\..\..\ace\IPC_SAP.i"\ + "..\..\..\ace\Log_Msg.h"\ + "..\..\..\ace\Log_Priority.h"\ + "..\..\..\ace\Log_Record.h"\ + "..\..\..\ace\Log_Record.i"\ + "..\..\..\ace\Malloc.h"\ + "..\..\..\ace\Malloc.i"\ + "..\..\..\ace\Malloc_Base.h"\ + "..\..\..\ace\Malloc_T.cpp"\ + "..\..\..\ace\Malloc_T.h"\ + "..\..\..\ace\Malloc_T.i"\ + "..\..\..\ace\Managed_Object.cpp"\ + "..\..\..\ace\Managed_Object.h"\ + "..\..\..\ace\Managed_Object.i"\ + "..\..\..\ace\Map_Manager.cpp"\ + "..\..\..\ace\Map_Manager.h"\ + "..\..\..\ace\Map_Manager.i"\ + "..\..\..\ace\Mem_Map.h"\ + "..\..\..\ace\Mem_Map.i"\ + "..\..\..\ace\Memory_Pool.h"\ + "..\..\..\ace\Memory_Pool.i"\ + "..\..\..\ace\Message_Block.h"\ + "..\..\..\ace\Message_Block.i"\ + "..\..\..\ace\Message_Queue.h"\ + "..\..\..\ace\Message_Queue.i"\ + "..\..\..\ace\Message_Queue_T.cpp"\ + "..\..\..\ace\Message_Queue_T.h"\ + "..\..\..\ace\Message_Queue_T.i"\ + "..\..\..\ace\Module.cpp"\ + "..\..\..\ace\Module.h"\ + "..\..\..\ace\Module.i"\ + "..\..\..\ace\Object_Manager.h"\ + "..\..\..\ace\Object_Manager.i"\ + "..\..\..\ace\OS.h"\ + "..\..\..\ace\OS.i"\ + "..\..\..\ace\Reactor.h"\ + "..\..\..\ace\Reactor.i"\ + "..\..\..\ace\Reactor_Impl.h"\ + "..\..\..\ace\Service_Config.h"\ + "..\..\..\ace\Service_Config.i"\ + "..\..\..\ace\Service_Object.h"\ + "..\..\..\ace\Service_Object.i"\ + "..\..\..\ace\Service_Repository.h"\ + "..\..\..\ace\Service_Repository.i"\ + "..\..\..\ace\Service_Types.h"\ + "..\..\..\ace\Service_Types.i"\ + "..\..\..\ace\Shared_Object.h"\ + "..\..\..\ace\Shared_Object.i"\ + "..\..\..\ace\Signal.h"\ + "..\..\..\ace\Signal.i"\ + "..\..\..\ace\Singleton.cpp"\ + "..\..\..\ace\Singleton.h"\ + "..\..\..\ace\Singleton.i"\ + "..\..\..\ace\SOCK.h"\ + "..\..\..\ace\SOCK.i"\ + "..\..\..\ace\SOCK_Acceptor.h"\ + "..\..\..\ace\SOCK_Acceptor.i"\ + "..\..\..\ace\SOCK_Connector.h"\ + "..\..\..\ace\SOCK_Connector.i"\ + "..\..\..\ace\SOCK_Dgram.h"\ + "..\..\..\ace\SOCK_Dgram.i"\ + "..\..\..\ace\SOCK_Dgram_Mcast.h"\ + "..\..\..\ace\SOCK_Dgram_Mcast.i"\ + "..\..\..\ace\SOCK_IO.h"\ + "..\..\..\ace\SOCK_IO.i"\ + "..\..\..\ace\SOCK_Stream.h"\ + "..\..\..\ace\SOCK_Stream.i"\ + "..\..\..\ace\SString.h"\ + "..\..\..\ace\SString.i"\ + "..\..\..\ace\Strategies.h"\ + "..\..\..\ace\Strategies.i"\ + "..\..\..\ace\Strategies_T.cpp"\ + "..\..\..\ace\Strategies_T.h"\ + "..\..\..\ace\Strategies_T.i"\ + "..\..\..\ace\Stream_Modules.cpp"\ + "..\..\..\ace\Stream_Modules.h"\ + "..\..\..\ace\Stream_Modules.i"\ + "..\..\..\ace\streams.h"\ + "..\..\..\ace\SV_Semaphore_Complex.h"\ + "..\..\..\ace\SV_Semaphore_Complex.i"\ + "..\..\..\ace\SV_Semaphore_Simple.h"\ + "..\..\..\ace\SV_Semaphore_Simple.i"\ + "..\..\..\ace\Svc_Conf_Tokens.h"\ + "..\..\..\ace\Svc_Handler.cpp"\ + "..\..\..\ace\Svc_Handler.h"\ + "..\..\..\ace\Svc_Handler.i"\ + "..\..\..\ace\Synch.h"\ + "..\..\..\ace\Synch.i"\ + "..\..\..\ace\Synch_Options.h"\ + "..\..\..\ace\Synch_Options.i"\ + "..\..\..\ace\Synch_T.cpp"\ + "..\..\..\ace\Synch_T.h"\ + "..\..\..\ace\Synch_T.i"\ + "..\..\..\ace\Task.h"\ + "..\..\..\ace\Task.i"\ + "..\..\..\ace\Task_T.cpp"\ + "..\..\..\ace\Task_T.h"\ + "..\..\..\ace\Task_T.i"\ + "..\..\..\ace\Thread.h"\ + "..\..\..\ace\Thread.i"\ + "..\..\..\ace\Thread_Manager.h"\ + "..\..\..\ace\Thread_Manager.i"\ + "..\..\..\ace\Time_Value.h"\ + "..\..\..\ace\Timer_Queue.h"\ + "..\..\..\ace\Timer_Queue_T.cpp"\ + "..\..\..\ace\Timer_Queue_T.h"\ + "..\..\..\ace\Timer_Queue_T.i"\ + "..\..\..\ace\Trace.h"\ + "..\..\..\ace\WFMO_Reactor.h"\ + "..\..\..\ace\WFMO_Reactor.i"\ + "..\..\..\ace\ws2tcpip.h"\ + "..\..\tao\any.h"\ + "..\..\tao\any.i"\ + "..\..\tao\cdr.h"\ + "..\..\tao\cdr.i"\ + "..\..\tao\CDR_Interpreter.h"\ + "..\..\tao\Client_Strategy_Factory.h"\ + "..\..\tao\corba.h"\ + "..\..\tao\CurrentC.h"\ + "..\..\tao\CurrentC.i"\ + "..\..\tao\debug.h"\ + "..\..\tao\default_client.h"\ + "..\..\tao\default_client.i"\ + "..\..\tao\default_server.h"\ + "..\..\tao\default_server.i"\ + "..\..\tao\Environment.h"\ + "..\..\tao\Environment.i"\ + "..\..\tao\Exception.h"\ + "..\..\tao\Exception.i"\ + "..\..\tao\giop.h"\ + "..\..\tao\giop.i"\ + "..\..\tao\Invocation.h"\ + "..\..\tao\Invocation.i"\ + "..\..\tao\marshal.h"\ + "..\..\tao\marshal.i"\ + "..\..\tao\nvlist.h"\ + "..\..\tao\NVList.i"\ + "..\..\tao\object.h"\ + "..\..\tao\object.i"\ + "..\..\tao\Object_KeyC.h"\ + "..\..\tao\Object_KeyC.i"\ + "..\..\tao\Operation_Table.h"\ + "..\..\tao\orb.h"\ + "..\..\tao\ORB.i"\ + "..\..\tao\orb_core.h"\ + "..\..\tao\orb_core.i"\ + "..\..\tao\orbconf.h"\ + "..\..\tao\params.h"\ + "..\..\tao\params.i"\ + "..\..\tao\poa.h"\ + "..\..\tao\POA.i"\ + "..\..\tao\POA_CORBA.h"\ + "..\..\tao\poa_macros.h"\ + "..\..\tao\poaC.h"\ + "..\..\tao\poaC.i"\ + "..\..\tao\poaS.h"\ + "..\..\tao\poaS.i"\ + "..\..\tao\PolicyC.h"\ + "..\..\tao\PolicyC.i"\ + "..\..\tao\Principal.h"\ + "..\..\tao\Principal.i"\ + "..\..\tao\request.h"\ + "..\..\tao\Request.i"\ + "..\..\tao\sequence.h"\ + "..\..\tao\sequence.i"\ + "..\..\tao\Sequence_T.cpp"\ + "..\..\tao\Sequence_T.h"\ + "..\..\tao\Sequence_T.i"\ + "..\..\tao\servant_base.h"\ + "..\..\tao\Server_Request.h"\ + "..\..\tao\Server_Request.i"\ + "..\..\tao\Server_Strategy_Factory.h"\ + "..\..\tao\singletons.h"\ + "..\..\tao\stub.h"\ + "..\..\tao\stub.i"\ + "..\..\tao\TAO.h"\ + "..\..\tao\typecode.h"\ + "..\..\tao\typecode.i"\ + "..\..\tao\Union.h"\ + "..\..\tao\varout.cpp"\ + "..\..\tao\varout.h"\ + "..\..\tao\varout.i"\ + "..\orbsvcs\CosNamingC.h"\ + "..\orbsvcs\CosNamingC.i"\ + "..\orbsvcs\CosNamingS.h"\ + "..\orbsvcs\CosNamingS.i"\ + "..\orbsvcs\CosNamingS_T.cpp"\ + "..\orbsvcs\CosNamingS_T.h"\ + "..\orbsvcs\CosNamingS_T.i"\ + "..\orbsvcs\IOR_Multicast.h"\ + "..\orbsvcs\Naming\Entries.h"\ + "..\orbsvcs\Naming\Naming_Utils.h"\ + "..\orbsvcs\orbsvcs_export.h"\ + ".\Naming_Service.h"\ + +NODEP_CPP_NAMIN=\ + "..\..\..\ace\sys_conf.h"\ + "..\..\tao\align.h"\ + "..\..\tao\connect.h"\ + "..\..\tao\connect.i"\ + "..\..\tao\IIOP_Object.h"\ + "..\..\tao\IIOP_Object.i"\ + "..\..\tao\IIOP_ORB.h"\ + "..\..\tao\IIOP_ORB.i"\ + "..\..\tao\Object_Table.h"\ + "..\..\tao\ORB_Strategies_T.cpp"\ + "..\..\tao\ORB_Strategies_T.h"\ + "..\..\tao\ORB_Strategies_T.i"\ + "..\orbsvcs\Naming\CosNaming_i.h"\ + + +!ELSEIF "$(CFG)" == "Naming_Service - Win32 Alpha Release" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\CosNaming_i.h +# End Source File +# Begin Source File + +SOURCE=.\Naming_Service.h +# End Source File +# Begin Source File + +SOURCE=.\NS_CosNaming.h +# End Source File +# End Group +# End Target +# End Project diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.dsw b/TAO/orbsvcs/Naming_Service/Naming_Service.dsw index e306b797e57..a9dad4da497 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.dsw +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.dsw @@ -1,29 +1,41 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "Naming_Service"=.\Naming_Service.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "NT_Naming_Service"=.\NT_Naming_Service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "Naming_Service"=.\Naming_Service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/TAO/orbsvcs/Naming_Service/README b/TAO/orbsvcs/Naming_Service/README index f309d51bc0f..595fe1d003a 100644 --- a/TAO/orbsvcs/Naming_Service/README +++ b/TAO/orbsvcs/Naming_Service/README @@ -1,170 +1,256 @@ // $Id$ -This directory contains the files that implement a server for the TAO -Naming Service. - -To Run: -====== - -% Naming_Server [-ORBnameserviceport nsport] - [-o ior_output_file] - [-p pid_file_name] - [-s context_size] - [-t time] - [-f persitence_file_name] - -Optional Command-line Arguments: -=============================== - nsport - Multicast port for listening for requests from - clients trying to bootstrap to a Naming Service - through the use of multicast. - - output_file +This directory contains files that implement a server for the TAO +Naming Service. In addition, it contains files that run the TAO +Naming Service as a Windows NT Service. Both of these services are +described below. + +How to Run the TAO Naming Service +================================= + +1. Syntax + + % Naming_Server [-ORBNameServicePort nsport] + [-o ior_output_file] + [-p pid_file_name] + [-s context_size] + [-t time] + [-f persitence_file_name] + +2. Optional Command-line Arguments + + -ORBNameServicePort nsport + Multicast port for listening for requests from clients + trying to bootstrap to a Naming Service through the + use of multicast. + + -o ior_output_file The name of the file, in which to store the IOR of the root Naming Service context. - pid_file_name + -p pid_file_name The name of the file, in which to store the process id of the Naming Service server. - context_size - Size of the hash table allocated for - the root Naming Context (if one is created). All - contexts created under the root will use the same - size for their hash tables. The default is 1024. + -s context_size + Size of the hash table allocated for the root Naming + Context (if one is created). All contexts created + under the root will use the same size for their hash + tables. The default is 1024. - time + -t time How long (in seconds) the server should listen for client requests before terminating. - persistence_file_name + -f persistence_file_name The name of the file to use to store/retrieve persistent state of the Naming Service. Without this - option, Naming Service is started in non-persistent mode. + option, Naming Service is started in non-persistent + mode. -Environment Variables: -===================== +3. Environment Variables NameServicePort - Multicast port for listening for requests from - clients trying to bootstrap to a Naming Service - through the use of multicast. - -Persistence: -=========== - -TAO Naming Service has an optional persistence capability. By -default, the Naming Service is started in a non-persistent mode. -Supplying "-f" command-line option to the server causes a persistent -version of the Naming Service to run. - -The file specified with the "-f" option is used to store the -persistent state of the Naming Service, i.e., all Naming Contexts and -their bindings. When "-f" option is specified: - - 1. If the specified file does not exist, it is created - and used to store the state of the Naming Service. An initial - (root) Naming Context is also created. - - 2. If the specified file exists, it is scanned and: - a) If any inconsistency is detected in the - stored state, or the file is not recognized by - the Naming Service, the server exits. (This - may happen, for example, if a server or host - crashed in the middle of writing a record to - this file on a previous run). A - noncorrupted version of the file must be used instead. - - b) If the file is recognized and is ok, the - state stored in the file becomes the current state of - the Naming Service. - - -Implementation Policies: -======================= - -- Destroying Binding Iterators - A binding iterator is destroyed when client invokes - <destroy> operation either on the iterator itself or on - the naming context it is iterating over. In both cases, - subsequent calls on the binding iterator object will - cause OBJECT_NOT_EXIST exception. - -- Dealing with orphaned contexts - This implementation of the Naming Service does not - include any form of 'garbage collection' for orphaned - naming contexts. It is solely the responsibility of - clients to clean up after themselves and not leak server - resources. All the resources, including orphaned - contexts, are released during the Naming Server - shutdown. - -Clients: ways to bootstrap to the Naming Service: -================================================ - -There are several methods for a client to bootstrap to a Naming -Service, i.e., there are several mechanisms <resolve_initial_references> can use -when asked for "NameService". - - 1. By default (unless other options are specified - see items 2 - and 3 below), ip multicast is used to locate a Naming - Service. TAO Naming Server is listening for client multicast - requests on a specified port. On the client side, - <resolve_initial_references> sends out a multicast request - on the network, trying to locate a Naming Service. When a - Naming Server receives a multicast request from a client, it - replies to the sender with the ior of its root - Naming Context. Note, the port used for this bootstrapping - process, i.e., 'multicast port', has nothing to do with the - ORB port used for CORBA communication. Other points worth - mentioning: - - - A client and a server will only click through this - multicast protocol if they are using the same multicast - port. For both client and server -ORBnameserviceport - command-line option and NameServicePort environment - variable can be used to specify the multicast port to use. - If none is specified, the default port is used. (The - ability to specify multicast ports can be used to match - certain clients with certain Naming Servers, when there - are more than one Naming Server running on the network). - - - If there are several Naming Servers running on the - network, each listening on the same port for - multicast requests, each will send a reply to a client's - request. The client's orb will use the first response it - receives, so the Naming Service will, in fact, be selected at - random. - - Since this mechanism is proprietary to TAO (i.e., - non-standard), it only works when both client and server are - written using TAO. There is no way to turn multicasting - off, but it is used only as a last resort, i.e., any of the - options below will override it. - - When OS platform doesn't support multicast, or client or - server isn't written using TAO, or a more reliable location - method is desired, etc., one of the options below can be - used to bootstrap to the Naming Service. - - 2. Command-line option -ORBnameserviceior or environment - variable NameServiceIOR can be used on the client side to - specify the object that the call to - <resolve_initial_references> should return to the client. - (On the server side, -o option can be used to get the ior). - - Example (Unix, same host): - - % TAO_ROOT/orbsvcs/Naming_Service -o ior_file - % my_client -ORBnameserviceior file://ior_file - - On the first line, we start the Naming Service, and output - its ior to <ior_file>. On the second line, we start some - client, and specify the ior <resolve_initial_references> - should return for the Naming Service in a file format. - - 3. TAO implements Interoperable Naming Service. So, most of the - initialzation options provided by INS can be used to - bootstrap to the Naming Service (see TAO's releasenotes for the - status of INS implementation). + Multicast port for listening for requests from clients + trying to bootstrap to a Naming Service through the + use of multicast. + +4. Persistence + + TAO Naming Service has an optional persistence capability. By + default, the Naming Service is started in a non-persistent + mode. Supplying "-f" command-line option to the server causes + a persistent version of the Naming Service to run. + + The file specified with the "-f" option is used to store the + persistent state of the Naming Service, i.e., all Naming + Contexts and their bindings. When "-f" option is specified: + + 1. If the specified file does not exist, it is created and + used to store the state of the Naming Service. An initial + (root) Naming Context is also created. + + 2. If the specified file exists, it is scanned and: + + a) If any inconsistency is detected in the stored + state, or the file is not recognized by the Naming + Service, the server exits. (This may happen, for + example, if a server or host crashed in the middle of + writing a record to this file on a previous run). A + noncorrupted version of the file must be used instead. + + b) If the file is recognized and is ok, the state + stored in the file becomes the current state of the + Naming Service. + +5. Implementation Policies + + a. Destroying Binding Iterators + + A binding iterator is destroyed when client invokes + <destroy> operation either on the iterator itself or + on the naming context it is iterating over. In both + cases, subsequent calls on the binding iterator object + will cause OBJECT_NOT_EXIST exception. + + b. Dealing with orphaned contexts + + This implementation of the Naming Service does not + include any form of 'garbage collection' for orphaned + naming contexts. It is solely the responsibility of + clients to clean up after themselves and not leak + server resources. All the resources, including + orphaned contexts, are released during the Naming + Server shutdown. + +6. Clients: ways to bootstrap to the Naming Service: + + There are several methods for a client to bootstrap to a + Naming Service, i.e., there are several mechanisms + <resolve_initial_references> can use when asked for + "NameService". + + 1. Multicast + + By default (unless other options are specified - see + items 2 and 3 below), ip multicast is used to locate a + Naming Service. TAO Naming Server is listening for + client multicast requests on a specified port. On the + client side, <resolve_initial_references> sends out a + multicast request on the network, trying to locate a + Naming Service. When a Naming Server receives a + multicast request from a client, it replies to the + sender with the ior of its root Naming Context. Note, + the port used for this bootstrapping process, i.e., + 'multicast port', has nothing to do with the ORB port + used for CORBA communication. Other points worth + mentioning: + + - A client and a server will only click through this + multicast protocol if they are using the same + multicast port. For both client and server + -ORBnameserviceport command-line option and + NameServicePort environment variable can be used to + specify the multicast port to use. If none is + specified, the default port is used. (The ability + to specify multicast ports can be used to match + certain clients with certain Naming Servers, when + there are more than one Naming Server running on the + network). + + - If there are several Naming Servers running on the + network, each listening on the same port for + multicast requests, each will send a reply to a + client's request. The client's orb will use the + first response it receives, so the Naming Service + will, in fact, be selected at random. + + Since this mechanism is proprietary to TAO (i.e., + non-standard), it only works when both client and + server are written using TAO. There is no way to turn + multicasting off, but it is used only as a last + resort, i.e., any of the options below will override + it. + + When OS platform doesn't support multicast, or client + or server isn't written using TAO, or a more reliable + location method is desired, etc., one of the options + below can be used to bootstrap to the Naming Service. + + 2. Command-line options + + The -ORBNameServiceIOR or environment variable + NameServiceIOR can be used on the client side to + specify the object that the call to + <resolve_initial_references> should return to the + client. (On the server side, -o option can be used to + get the ior). + + Example (Unix, same host): + + % TAO_ROOT/orbsvcs/Naming_Service -o ior_file + % my_client -ORBnameserviceior file://ior_file + + On the first line, we start the Naming + Service, and output its ior to <ior_file>. On + the second line, we start some client, and + specify the ior <resolve_initial_references> + should return for the Naming Service in a file + format. + + 3. Interoperable Naming Service. + + TAO implements the standard CORBA Interoperable Naming + Service (ING). Therefore, most initialization options + provided by INS can be used to bootstrap to the Naming + Service (see TAO's releasenotes for the status of INS + implementation). + +How to use the NT_Naming_Service +================================ + +1. Syntax + + % NT_Naming_Server [-i value] + [-r] + [-s] + [-k] + [-t n] + [-d] + +2. Optional Command-line Arguments + + -i value + Install this program as an NT service, with specified startup + + -r + Remove this program from the Service Manager + -s + Start the service + + -k + Kill the service + + -t value + Set startup for an existing service + + -d + Debug; run as a regular application + +3. Usage + + To see different stages of an NT service application, you have + to run the program several times, with different options. + Please note: run with only one option at a time. + + a. First, you must initialize the service in the NT SCM + database. Run NT_Naming_Service with -in, where n is one of + the following startup options: + + // Start Type (from WinNT.h) + // + #define SERVICE_SYSTEM_START 0x00000001 + #define SERVICE_AUTO_START 0x00000002 + #define SERVICE_DEMAND_START 0x00000003 + #define SERVICE_DISABLED 0x00000004 + + If only -i is specified, SERVICE_AUTO_START is default option. + + b. Now you are ready to run the actual service. Run + NT_Naming_Service again, this time with -s option. If the + service starts successfully, it will ring the system + bell every second or so until the service is stopped. + + c. To stop service execution, run NT_Naming_Service with the + -k option. + + d. To remove the service from the Service Control Manager + database, run NT_Naming_Service with -r. + + In addition, once you have initialized this service (by using + the -i option) you can change its startup type to one of the + other values above. To do this, run NT_Naming_Service with + -tn option. n is as explained above for -i. + + In order to debug the service's execution itself, use the -d + option. diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp index b5cc3efe81c..642be071640 100644 --- a/TAO/tao/IIOP_Connect.cpp +++ b/TAO/tao/IIOP_Connect.cpp @@ -116,7 +116,7 @@ TAO_IIOP_Server_Connection_Handler::open (void*) #if defined (TCP_NODELAY) int nodelay = 1; - if (this->peer ().set_option (IPPROTO_TCP, + if (this->peer ().set_option (ACE_IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay, sizeof (nodelay)) == -1) @@ -354,13 +354,13 @@ TAO_IIOP_Client_Connection_Handler::open (void *) if (this->peer ().set_option (SOL_SOCKET, SO_SNDBUF, - (void *) &sndbufsize, + ACE_reinterpret_cast (void *, &sndbufsize), sizeof (sndbufsize)) == -1 && errno != ENOTSUP) return -1; else if (this->peer ().set_option (SOL_SOCKET, SO_RCVBUF, - (void *) &rcvbufsize, + ACE_reinterpret_cast (void *, &rcvbufsize), sizeof (rcvbufsize)) == -1 && errno != ENOTSUP) return -1; @@ -369,7 +369,7 @@ TAO_IIOP_Client_Connection_Handler::open (void *) int nodelay = 1; #if defined (TCP_NODELAY) - if (this->peer ().set_option (IPPROTO_TCP, + if (this->peer ().set_option (ACE_IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay, sizeof (nodelay)) == -1) @@ -54,7 +54,7 @@ Todd Hoff <thm@ictv.com> George <george@truffula.fp.trw.com> Brad Needham <bneedham@ix.netcom.com> Leslee Xu <lxu@ics.uci.edu> -Detlef Becker <detlef.becker@med.siemens.de> +Detlef Becker <Detlef.Becker@med.siemens.de> Bruce Worden <bruce@betsy.gps.caltech.edu> Chris Tarr <ctarr@objectspace.co> Bill Sears <wsears@world.std.com> @@ -73,7 +73,7 @@ Giang Hoang Nguyen <yang@titan.com> Carlos Garcia Braschi <cgarcia@caramba.tid.es> Jam Hamidi <jh1@osi.com> Eric Vaughan <evaughan@arinc.com> -Karl-Heinz Dorn <karlheinz.dorn@med.siemens.de> +Karlheinz Dorn <Karlheinz.Dorn@med.siemens.de>, Steve Ritter <ritter@titan.com> Chandra Venkatapathy <cvenkat@develop.bsis.com> Matt Stevens <mstevens@kirk.softeng.infonautics.com> @@ -709,6 +709,7 @@ David McCann <david.mccann@alcatel.at> Ruediger Franke <Ruediger.Franke@decrc.abb.de> Brian Jones <bjones@edgemail.com> Michael Garvin <mgarvin@nortelnetworks.com> +Mike Vitalo <mvitalo@infoglide.com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson. Paul devised the recursive Makefile scheme that diff --git a/ace/ACE.h b/ace/ACE.h index 88b74211d55..f28e1f6745f 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -701,9 +701,9 @@ private: // non-blocking status of <handle>). static u_int init_fini_count_; - // Counter to match init ()/fini () calls. init () must increment - // it; fini () must decrement it. fini () then does nothing until - // it reaches 0. + // Counter to match <init>/<fini> calls. <init> must increment it; + // <fini> must decrement it. <fini> then does nothing until it + // reaches 0. static size_t pagesize_; // Size of a VM page. diff --git a/ace/ARGV.h b/ace/ARGV.h index eb4a9593e47..4dcc762065c 100644 --- a/ace/ARGV.h +++ b/ace/ARGV.h @@ -38,26 +38,25 @@ public: // Converts <buf> into an <argv>-style vector of strings. If // <substitute_env_args> is enabled then we'll substitute the // environment variables for each $ENV encountered in the string. - // The subscript and argv() operations are not allowed on an + // The subscript and <argv> operations are not allowed on an // ACE_ARGV created this way. ACE_ARGV (ASYS_TCHAR *argv[], int substitute_env_args = 1); // Converts <argv> into a linear string. If <substitute_env_args> // is enabled then we'll substitute the environment variables for - // each $ENV encountered in the string. - // The buf() operation is not allowed on an ACE_ARGV created - // this way. + // each $ENV encountered in the string. The <buf> operation is not + // allowed on an ACE_ARGV created this way. ACE_ARGV (ASYS_TCHAR *first_argv[], ASYS_TCHAR *second_argv[], int substitute_env_args =1); // Creates an ACE_ARGV which is the concatenation of the first_argv // and the second argv. The argv arguments should be null pointer terminated. ACE_ARGV (int substitute_env_args = 1); - // Entry point for creating an ASYS_TCHAR *[] command line iteratively - // via the add() method. The argv() and buf() method calls are - // allowed, and the result is recreated when called multiple times. - // The subscript operator is not allowed. + // Entry point for creating an ASYS_TCHAR *[] command line + // iteratively via the <add> method. The <argv> and <buf> methods + // are allowed, and the result is recreated when called multiple + // times. The subscript operator is not allowed. ~ACE_ARGV (void); // Destructor. @@ -99,7 +98,7 @@ public: TO_PTR_ARRAY = 2, // ACE_ARGV converts ASYS_TCHAR *argv[] to buf[] ITERATIVE = 3 - // Builds buf[] or ASYS_TCHAR *argv[] iteratively with add() + // Builds buf[] or ASYS_TCHAR *argv[] iteratively with <add>. }; private: diff --git a/ace/Acceptor.h b/ace/Acceptor.h index d42360a35e8..615229f7cea 100644 --- a/ace/Acceptor.h +++ b/ace/Acceptor.h @@ -131,7 +131,7 @@ protected: virtual int activate_svc_handler (SVC_HANDLER *svc_handler); // Bridge method for activating a <svc_handler> with the appropriate // concurrency strategy. The default behavior of this method is to - // activate the SVC_HANDLER by calling its open() method (which + // activate the SVC_HANDLER by calling its <open> method (which // allows the SVC_HANDLER to define its own concurrency strategy). // However, subclasses can override this strategy to do more // sophisticated concurrency activations (such as making the diff --git a/ace/Asynch_IO_Impl.cpp b/ace/Asynch_IO_Impl.cpp index 9baab6f5e04..a3df938c1ec 100644 --- a/ace/Asynch_IO_Impl.cpp +++ b/ace/Asynch_IO_Impl.cpp @@ -11,4 +11,40 @@ #include "ace/Asynch_IO_Impl.i" #endif /* __ACE_INLINE__ */ +ACE_Asynch_Operation_Impl::~ACE_Asynch_Operation_Impl (void) +{ +} + +ACE_Asynch_Read_Stream_Impl::~ACE_Asynch_Read_Stream_Impl (void) +{ +} + +ACE_Asynch_Write_Stream_Impl::~ACE_Asynch_Write_Stream_Impl (void) +{ +} + +ACE_Asynch_Read_File_Impl::~ACE_Asynch_Read_File_Impl (void) +{ +} + +ACE_Asynch_Read_File_Result_Impl::~ACE_Asynch_Read_File_Result_Impl (void) +{ +} + +ACE_Asynch_Write_File_Result_Impl::~ACE_Asynch_Write_File_Result_Impl (void) +{ +} + +ACE_Asynch_Accept_Result_Impl::~ACE_Asynch_Accept_Result_Impl (void) +{ +} + +ACE_Asynch_Transmit_File_Impl::~ACE_Asynch_Transmit_File_Impl (void) +{ +} + +ACE_Asynch_Transmit_File_Result_Impl::~ACE_Asynch_Transmit_File_Result_Impl (void) +{ +} + #endif /* ACE_WIN32 || ACE_HAS_WINCE */ diff --git a/ace/Asynch_IO_Impl.h b/ace/Asynch_IO_Impl.h index 834817032b5..93d62490808 100644 --- a/ace/Asynch_IO_Impl.h +++ b/ace/Asynch_IO_Impl.h @@ -110,11 +110,8 @@ class ACE_Export ACE_Asynch_Operation_Impl // Abstract base class for all the concrete implementation // classes that provide different implementations for the // ACE_Asynch_Operation. - // - // = DESCRIPTION - // public: - virtual ~ACE_Asynch_Operation_Impl () {} + virtual ~ACE_Asynch_Operation_Impl (void); virtual int open (ACE_Handler &handler, ACE_HANDLE handle, @@ -177,7 +174,7 @@ class ACE_Export ACE_Asynch_Read_Stream_Result_Impl : public virtual ACE_Asynch_ // = DESCRIPTION // public: - virtual ~ACE_Asynch_Read_Stream_Result_Impl () {} + virtual ~ACE_Asynch_Read_Stream_Result_Impl (void); virtual u_long bytes_to_read (void) const = 0; // The number of bytes which were requested at the start of the @@ -231,7 +228,7 @@ class ACE_Export ACE_Asynch_Write_Stream_Result_Impl : public virtual ACE_Asynch // = DESCRIPTION // public: - virtual ~ACE_Asynch_Write_Stream_Result_Impl () {} + virtual ~ACE_Asynch_Write_Stream_Result_Impl (void); virtual u_long bytes_to_write (void) const = 0; // The number of bytes which were requested at the start of the @@ -259,7 +256,7 @@ class ACE_Export ACE_Asynch_Read_File_Impl : public virtual ACE_Asynch_Read_Stre // = DESCRIPTION // public: - virtual ~ACE_Asynch_Read_File_Impl () {} + virtual ~ACE_Asynch_Read_File_Impl (void); virtual int read (ACE_Message_Block &message_block, u_long bytes_to_read, @@ -298,7 +295,7 @@ class ACE_Export ACE_Asynch_Read_File_Result_Impl : public virtual ACE_Asynch_Re // = DESCRIPTION // public: - virtual ~ACE_Asynch_Read_File_Result_Impl () {} + virtual ~ACE_Asynch_Read_File_Result_Impl (void); // Destructor. protected: @@ -358,7 +355,7 @@ class ACE_Export ACE_Asynch_Write_File_Result_Impl : public virtual ACE_Asynch_W // = DESCRIPTION // public: - virtual ~ACE_Asynch_Write_File_Result_Impl () {} + virtual ~ACE_Asynch_Write_File_Result_Impl (void); protected: ACE_Asynch_Write_File_Result_Impl (void); @@ -410,7 +407,7 @@ class ACE_Export ACE_Asynch_Accept_Result_Impl : public virtual ACE_Asynch_Resul // = DESCRIPTION // public: - virtual ~ACE_Asynch_Accept_Result_Impl () {} + virtual ~ACE_Asynch_Accept_Result_Impl (void); virtual u_long bytes_to_read (void) const = 0; // The number of bytes which were requested at the start of the @@ -441,7 +438,7 @@ class ACE_Asynch_Transmit_File_Impl : public virtual ACE_Asynch_Operation_Impl // = DESCRIPTION // public: - virtual ~ACE_Asynch_Transmit_File_Impl () {} + virtual ~ACE_Asynch_Transmit_File_Impl (void); virtual int transmit_file (ACE_HANDLE file, ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, @@ -471,7 +468,7 @@ class ACE_Export ACE_Asynch_Transmit_File_Result_Impl : public virtual ACE_Async // = DESCRIPTION // public: - virtual ~ACE_Asynch_Transmit_File_Result_Impl () {} + virtual ~ACE_Asynch_Transmit_File_Result_Impl (void); virtual ACE_HANDLE socket (void) const = 0; // Socket used for transmitting the file. diff --git a/ace/Based_Pointer_T.cpp b/ace/Based_Pointer_T.cpp index 0e97efcee87..fefe3421b32 100644 --- a/ace/Based_Pointer_T.cpp +++ b/ace/Based_Pointer_T.cpp @@ -8,22 +8,21 @@ #include "ace/Based_Pointer_Repository.h" # define ACE_TRACEX(X) ACE_Trace ____ (ASYS_TEXT (X), __LINE__, ASYS_TEXT (__FILE__)) -// # define ACE_TRACEX(X) -// #if !defined (__ACE_INLINE__) +#if !defined (__ACE_INLINE__) #include "ace/Based_Pointer_T.i" -// #endif /* __ACE_INLINE__ */ +#endif /* __ACE_INLINE__ */ template <class CONCRETE> ACE_INLINE ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (void) { - ACE_TRACEX ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer"); + ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer"); } template <class CONCRETE> void ACE_Based_Pointer_Basic<CONCRETE>::dump (void) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::dump"); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\ntarget_ = %d\n"), this->target_)); @@ -36,7 +35,7 @@ template <class CONCRETE> ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (CONCRETE *initial) : ACE_Based_Pointer_Basic<CONCRETE> (initial) { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); } template <class CONCRETE> @@ -44,7 +43,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (void) : target_ (0), base_offset_ (0) { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); void *base_addr = 0; // Find the base address associated with our <this> pointer. Note @@ -53,7 +52,6 @@ ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (void) ACE_BASED_POINTER_REPOSITORY::instance ()->find (this, base_addr); this->base_offset_ = (char *) this - (char *) base_addr; - this->dump (); } template <class CONCRETE> @@ -61,23 +59,30 @@ ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (CONCRETE *rhs) : target_ (0), base_offset_ (0) { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); - void *base_addr = 0; - - // Find the base address associated with the <addr> pointer. Note - // that it's ok for <find> to return 0, which simply indicates that - // the address is not in memory-mapped virtual address space. - ACE_BASED_POINTER_REPOSITORY::instance ()->find (this, - base_addr); - this->base_offset_ = (char *) this - (char *) base_addr; - this->target_ = ((char *) rhs - (char *) base_addr); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); + + if (rhs == 0) + // Store a value of <target_> that indicate "NULL" pointer. + this->target_ = -1; + else + { + void *base_addr = 0; + + // Find the base address associated with the <addr> pointer. + // Note that it's ok for <find> to return 0, which simply + // indicates that the address is not in memory-mapped virtual + // address space. + ACE_BASED_POINTER_REPOSITORY::instance ()->find (this, + base_addr); + this->base_offset_ = (char *) this - (char *) base_addr; + this->target_ = ((char *) rhs - (char *) base_addr); + } } template <class CONCRETE> ACE_INLINE ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic"); ACE_ASSERT (!"not implemented"); void *base_addr = 0; @@ -89,15 +94,14 @@ ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (const ACE_Based_Poin base_addr); this->base_offset_ = (char *) this - (char *) base_addr; this->target_ = ((char *) &rhs - (char *) base_addr); - this->dump (); } template <class CONCRETE> ACE_INLINE ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (const ACE_Based_Pointer<CONCRETE> &rhs) : ACE_Based_Pointer_Basic<CONCRETE> (rhs) { - ACE_TRACEX ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer"); + ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer"); ACE_ASSERT (!"not implemented"); } -#endif/* ACE_BASED_POINTER_T_CPP */ +#endif /* ACE_BASED_POINTER_T_CPP */ diff --git a/ace/Based_Pointer_T.h b/ace/Based_Pointer_T.h index 0753b1980e5..82c40e2a87d 100644 --- a/ace/Based_Pointer_T.h +++ b/ace/Based_Pointer_T.h @@ -165,7 +165,7 @@ public: }; #if defined (__ACE_INLINE__) -// #include "ace/Based_Pointer_T.i" +#include "ace/Based_Pointer_T.i" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) diff --git a/ace/Based_Pointer_T.i b/ace/Based_Pointer_T.i index c37d3a894d9..4409abf03b0 100644 --- a/ace/Based_Pointer_T.i +++ b/ace/Based_Pointer_T.i @@ -6,35 +6,38 @@ template <class CONCRETE> ACE_INLINE CONCRETE * ACE_Based_Pointer<CONCRETE>::operator->(void) { - ACE_TRACEX ("ACE_Based_Pointer<CONCRETE>::operator->"); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator->"); return (CONCRETE *)(ACE_COMPUTE_BASED_POINTER (this)); } template <class CONCRETE> ACE_INLINE void ACE_Based_Pointer_Basic<CONCRETE>::operator = (CONCRETE *rhs) { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator="); - if (rhs != 0) + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator="); + if (rhs == 0) + // Store a value of <target_> that indicate "NULL" pointer. + this->target_ = -1; + else this->target_ = ((char *) rhs - ((char *) this - this->base_offset_)); - this->dump (); } template <class CONCRETE> ACE_INLINE void ACE_Based_Pointer<CONCRETE>::operator = (CONCRETE *rhs) { - ACE_TRACEX ("ACE_Based_Pointer<CONCRETE>::operator="); - this->target_ = ((char *) rhs - - ((char *) this - this->base_offset_)); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator="); + if (rhs == 0) + // Store a value of <target_> that indicate "NULL" pointer. + this->target_ = -1; + else + this->target_ = ((char *) rhs + - ((char *) this - this->base_offset_)); } template <class CONCRETE> ACE_INLINE CONCRETE ACE_Based_Pointer_Basic<CONCRETE>::operator *(void) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator *"); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator *"); return *ACE_reinterpret_cast (CONCRETE *, ACE_COMPUTE_BASED_POINTER (this)); } @@ -42,17 +45,18 @@ ACE_Based_Pointer_Basic<CONCRETE>::operator *(void) const template <class CONCRETE> ACE_INLINE CONCRETE * ACE_Based_Pointer_Basic<CONCRETE>::addr (void) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::addr"); - this->dump (); - return ACE_reinterpret_cast (CONCRETE *, - ACE_COMPUTE_BASED_POINTER (this)); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::addr"); + if (this->target_ == -1) + return 0; + else + return ACE_reinterpret_cast (CONCRETE *, + ACE_COMPUTE_BASED_POINTER (this)); } template <class CONCRETE> ACE_INLINE CONCRETE ACE_Based_Pointer_Basic<CONCRETE>::operator [] (long index) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator[]"); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator[]"); CONCRETE *c = ACE_reinterpret_cast (CONCRETE *, ACE_COMPUTE_BASED_POINTER (this)); return c[index]; @@ -61,56 +65,49 @@ ACE_Based_Pointer_Basic<CONCRETE>::operator [] (long index) const template <class CONCRETE> ACE_INLINE void ACE_Based_Pointer_Basic<CONCRETE>::operator += (long index) { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator+="); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator+="); this->base_offset_ += (index * sizeof (CONCRETE)); } template <class CONCRETE> ACE_INLINE int ACE_Based_Pointer_Basic<CONCRETE>::operator == (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator=="); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator=="); return ACE_COMPUTE_BASED_POINTER (this) == ACE_COMPUTE_BASED_POINTER (&rhs); } template <class CONCRETE> ACE_INLINE int ACE_Based_Pointer_Basic<CONCRETE>::operator != (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator!="); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator!="); return !(*this == rhs); } template <class CONCRETE> ACE_INLINE int ACE_Based_Pointer_Basic<CONCRETE>::operator < (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator<"); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator<"); return ACE_COMPUTE_BASED_POINTER (this) < ACE_COMPUTE_BASED_POINTER (&rhs); } template <class CONCRETE> ACE_INLINE int ACE_Based_Pointer_Basic<CONCRETE>::operator <= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator<="); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator<="); return ACE_COMPUTE_BASED_POINTER (this) <= ACE_COMPUTE_BASED_POINTER (&rhs); } template <class CONCRETE> ACE_INLINE int ACE_Based_Pointer_Basic<CONCRETE>::operator > (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator>"); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator>"); return ACE_COMPUTE_BASED_POINTER (this) > ACE_COMPUTE_BASED_POINTER (&rhs); } template <class CONCRETE> ACE_INLINE int ACE_Based_Pointer_Basic<CONCRETE>::operator >= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const { - ACE_TRACEX ("ACE_Based_Pointer_Basic<CONCRETE>::operator>="); - this->dump (); + ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator>="); return ACE_COMPUTE_BASED_POINTER (this) >= ACE_COMPUTE_BASED_POINTER (&rhs); } diff --git a/ace/CDR_Stream.h b/ace/CDR_Stream.h index 13dad9d7ab5..72a476628c1 100644 --- a/ace/CDR_Stream.h +++ b/ace/CDR_Stream.h @@ -450,9 +450,9 @@ private: // to be packed with the right alignment restrictions. It is mostly // designed for buffers of the basic types. // - // This operation uses memcpy(); as explained above it is expected - // that using assignment is faster that memcpy() for one element, - // but for several elements memcpy() should be more efficient, it + // This operation uses <memcpy>; as explained above it is expected + // that using assignment is faster that <memcpy> for one element, + // but for several elements <memcpy> should be more efficient, it // could be interesting to find the break even point and optimize // for that case, but that would be too platform dependent. @@ -474,7 +474,7 @@ private: char *&buf); // Grow the CDR stream. When it returns <buf> contains a pointer to // memory in the CDR stream, with at least <size> bytes ahead of it - // and aligned to an <align> boundary. It moved the wr_ptr() to <buf + // and aligned to an <align> boundary. It moved the <wr_ptr> to <buf // + size>. int do_byte_swap (void) const; @@ -701,9 +701,9 @@ public: // CDR stream from a socket or file. int grow (size_t newsize); - // Grow the internal buffer, reset rd_ptr() to the first byte in the - // new buffer that is properly aligned, and set wr_ptr() to - // rd_ptr() + newsize + // Grow the internal buffer, reset <rd_ptr> to the first byte in the + // new buffer that is properly aligned, and set <wr_ptr> to <rd_ptr> + // + newsize void reset_byte_order (int byte_order); // After reading and partially parsing the contents the user can @@ -789,9 +789,9 @@ private: // to be packed with the right alignment restrictions. It is mostly // designed for buffers of the basic types. // - // This operation uses memcpy(); as explained above it is expected - // that using assignment is faster that memcpy() for one element, - // but for several elements memcpy() should be more efficient, it + // This operation uses <memcpy>; as explained above it is expected + // that using assignment is faster that <memcpy> for one element, + // but for several elements <memcpy> should be more efficient, it // could be interesting to find the break even point and optimize // for that case, but that would be too platform dependent. diff --git a/ace/CORBA_Handler.h b/ace/CORBA_Handler.h index 5ca803b94a6..428127bcd75 100644 --- a/ace/CORBA_Handler.h +++ b/ace/CORBA_Handler.h @@ -117,10 +117,10 @@ public: // = Dynamic linking hooks. virtual int suspend (void); - // Atomically suspend all the threads associated with the <thr_mgr ()>. + // Atomically suspend all the threads associated with the <thr_mgr>. virtual int resume (void); - // Atomically resume all the threads associated with the <thr_mgr ()_>. + // Atomically resume all the threads associated with the <thr_mgr>. // = Iterations dictate # of <processNextEvent> calls per-callback. size_t iterations (void); @@ -138,7 +138,7 @@ public: protected: void get_orbix_descriptors (void); // Preinitialize any descriptors that Orbix is using. This is - // called in instance (). + // called in <instance>. ACE_ST_CORBA_Handler (void); // Constructors (ensure Singleton...). @@ -156,7 +156,7 @@ protected: // ACE_ST_CORBA_Handler is a singleton object. size_t iterations_; - // Number of iterations to process per processNextEvent() call. + // Number of iterations to process per <processNextEvent> call. }; #if defined (ACE_HAS_MT_ORBIX) && (ACE_HAS_MT_ORBIX != 0) @@ -193,10 +193,10 @@ public: // = Dynamic linking hooks. virtual int suspend (void); - // Atomically suspend all the threads associated with the <thr_mgr ()>. + // Atomically suspend all the threads associated with the <thr_mgr>. virtual int resume (void); - // Atomically resume all the threads associated with the <thr_mgr ()>. + // Atomically resume all the threads associated with the <thr_mgr>. void dump (void) const; // Dump the state of an object. @@ -216,8 +216,8 @@ protected: virtual int inRequestPreMarshal (ACE_CORBA_1 (Request) &r, ACE_CORBA_1 (Environment) &IT_env = ACE_CORBA_1 (default_environment)); - // Take the incoming request and pass it to this->handle_input() but - // through the Reactor. + // Take the incoming request and pass it to <handle_input> through + // the Reactor. static ACE_MT_CORBA_Handler *instance_; // ACE_MT_CORBA_Handler is a singleton object. diff --git a/ace/CORBA_Ref.h b/ace/CORBA_Ref.h index e5dbc821641..c38887ef1c9 100644 --- a/ace/CORBA_Ref.h +++ b/ace/CORBA_Ref.h @@ -45,10 +45,10 @@ public: ACE_CORBA_Ref (CORBA_REF *ref); // Contruction with an orbix ref. - // performs a ref->_duplicate(). + // performs a <CORBA_REF::_duplicate>. CORBA_REF *operator= (CORBA_REF *ref); - // Assignment performs a ref->_duplicate(). + // Assignment performs a <CORBA_REF::_duplicate>. operator CORBA_REF *(void) const; // Type operator @@ -64,7 +64,7 @@ public: // Pointer comparison. ~ACE_CORBA_Ref (void); - // Destruction: calls ref_->_release + // Destruction: calls <CORBA_REF::_release>. private: CORBA_REF *ref_; diff --git a/ace/Caching_Utility_T.h b/ace/Caching_Utility_T.h index 966bca32b9f..cb036782343 100644 --- a/ace/Caching_Utility_T.h +++ b/ace/Caching_Utility_T.h @@ -32,14 +32,14 @@ class ACE_Pair_Caching_Utility // Defines a helper class for the Caching Strategies. // // = DESCRIPTION - // This class defines the methods commonly used by the different - // caching strategies. For instance: clear_cache () method which - // decides and purges the entry from the container. Note: This - // class helps in the caching_strategies using a container - // containing entries of <KEY, ACE_Pair<VALUE, attributes>> - // kind. The attributes helps in deciding the entries to be - // purged. The Cleanup_Strategy is the callback class to which - // the entries to be cleaned up will be delegated. + // This class defines the methods commonly used by the different + // caching strategies. For instance: <clear_cache> method which + // decides and purges the entry from the container. Note: This + // class helps in the caching_strategies using a container + // containing entries of <KEY, ACE_Pair<VALUE, attributes>> + // kind. The attributes helps in deciding the entries to be + // purged. The Cleanup_Strategy is the callback class to which the + // entries to be cleaned up will be delegated. public: typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY; @@ -84,7 +84,7 @@ class ACE_Recyclable_Handler_Caching_Utility // // = DESCRIPTION // This class defines the methods commonly used by the different - // caching strategies. For instance: clear_cache () method which + // caching strategies. For instance: <clear_cache> method which // decides and purges the entry from the container. Note: This // class helps in the caching_strategies using a container // containing entries of <KEY, Svc_Handler> kind. The attributes @@ -136,7 +136,7 @@ class ACE_Handler_Caching_Utility // // = DESCRIPTION // This class defines the methods commonly used by the different - // caching strategies. For instance: clear_cache () method which + // caching strategies. For instance: <clear_cache> method which // decides and purges the entry from the container. Note: This // class helps in the caching_strategies using a container // containing entries of <KEY, HANDLER> kind where the HANDLER @@ -190,7 +190,7 @@ class ACE_Null_Caching_Utility // // = DESCRIPTION // This class defines the methods commonly used by the different - // caching strategies. For instance: clear_cache () method which + // caching strategies. For instance: <clear_cache> method which // decides and purges the entry from the container. Note: This // class is be used with the Null_Caching_Strategy. The // Cleanup_Strategy is the callback class to which the entries to diff --git a/ace/Connector.h b/ace/Connector.h index d01dc24d1e2..ddabc7351a4 100644 --- a/ace/Connector.h +++ b/ace/Connector.h @@ -245,7 +245,7 @@ protected: virtual int activate_svc_handler (SVC_HANDLER *svc_handler); // Bridge method for activating a <svc_handler> with the appropriate // concurrency strategy. The default behavior of this method is to - // activate the SVC_HANDLER by calling its open() method (which + // activate the SVC_HANDLER by calling its <open> method (which // allows the SVC_HANDLER to define its own concurrency strategy). // However, subclasses can override this strategy to do more // sophisticated concurrency activations (such as creating the @@ -311,7 +311,7 @@ protected: int reuse_addr, int flags, int perms); - // Implementation the connect() methods + // Implementation the <connect> methods. MAP_MANAGER handler_map_; // Lookup table that maps an I/O handle to a SVC_HANDLER *. diff --git a/ace/Containers_T.h b/ace/Containers_T.h index 81e0e07e9c7..410c1d23306 100644 --- a/ace/Containers_T.h +++ b/ace/Containers_T.h @@ -479,11 +479,11 @@ public: int get (T *&item, size_t slot = 0) const; // Get the <slot>th element in the set. Returns -1 if the element - // isn't in the range <0..size() - 1>, else 0. + // isn't in the range {0..<size> - 1}, else 0. int set (const T &item, size_t slot); // Set the <slot>th element in the set. Will pad out the set with - // empty nodes if <slot> is beyond the range <0..size() - 1>. + // empty nodes if <slot> is beyond the range {0..<size> - 1}. // Returns -1 on failure, 0 if <slot> isn't initially in range, and // 0 otherwise. @@ -638,10 +638,10 @@ public: // items in the list have been seen, else 1. T* advance_and_remove (int dont_remove); - // Advance the iterator while removing the original item from the list. - // Return a pointer points to the original (removed) item. If - // <dont_remove> equals 0, this function behaves like advance() but - // return 0 (NULL) instead. + // Advance the iterator while removing the original item from the + // list. Return a pointer points to the original (removed) item. + // If <dont_remove> equals 0, this function behaves like <advance> + // but return 0 (NULL) instead. // = STL-style iteration methods @@ -701,10 +701,10 @@ public: // items in the list have been seen, else 1. T* advance_and_remove (int dont_remove); - // Advance the iterator while removing the original item from the list. - // Return a pointer points to the original (removed) item. If - // <dont_remove> equals 0, this function behaves like advance() but - // return 0 (NULL) instead. + // Advance the iterator while removing the original item from the + // list. Return a pointer points to the original (removed) item. + // If <dont_remove> equals 0, this function behaves like <advance> + // but return 0 (NULL) instead. // = STL-style iteration methods @@ -798,7 +798,7 @@ public: int get (T *&item, size_t slot = 0); // Get the <slot>th element in the set. Returns -1 if the element - // isn't in the range <0..size() - 1>, else 0. + // isn't in the range {0..<size> - 1}, else 0. size_t size (void) const; // The number of items in the queue. @@ -970,7 +970,7 @@ public: // DEPRECATED int remove (void); - // Removes the current item (i.e., this->next()) from the list. + // Removes the current item (i.e., <next>) from the list. void dump (void) const; // Delegates to ACE_Double_Linked_List_Iterator. @@ -1021,7 +1021,7 @@ public: // DEPRECATED int remove (void); - // Removes the current item (i.e., this->next()) from the list. + // Removes the current item (i.e., <next>) from the list. void dump (void) const; // Delegates to ACE_Double_Linked_List_Iterator. @@ -1765,7 +1765,7 @@ public: int operator== (const ACE_Array<T> &s) const; // Compare this array with <s> for equality. Two arrays are equal - // if their size()'s are equal and all the elements from 0 .. size() + // if their <size>'s are equal and all the elements from 0 .. <size> // are equal. int operator!= (const ACE_Array<T> &s) const; diff --git a/ace/DEV_Connector.h b/ace/DEV_Connector.h index 088fd8be1df..db2173dd5b3 100644 --- a/ace/DEV_Connector.h +++ b/ace/DEV_Connector.h @@ -51,7 +51,7 @@ public: // the default value of <ACE_Addr::sap_any> then the user is letting // the OS do the binding. If <reuse_addr> == 1 then the // <local_addr> is reused, even if it hasn't been cleanedup yet. - // The <flags> and <perms> arguments are passed down to the open() + // The <flags> and <perms> arguments are passed down to the <open> // method. int connect (ACE_DEV_IO &new_io, @@ -74,7 +74,7 @@ public: // the default value of <ACE_Addr::sap_any> then the user is letting // the OS do the binding. If <reuse_addr> == 1 then the // <local_addr> is reused, even if it hasn't been cleanedup yet. - // The <flags> and <perms> arguments are passed down to the open() + // The <flags> and <perms> arguments are passed down to the <open> // method. int reset_new_handle (ACE_HANDLE handle); diff --git a/ace/Dirent.h b/ace/Dirent.h index f606c77fc1b..5f7ad9ad7e1 100644 --- a/ace/Dirent.h +++ b/ace/Dirent.h @@ -60,7 +60,7 @@ public: // whether entries are returned for dot or dot-dot. The pointer // returned by <readdir> points to data that may be overwritten by // another call to <readdir> on the same directory stream. This - // data shall not be overwritten by another call to readdir() on a + // data shall not be overwritten by another call to <readdir> on a // different directory stream. <readdir> may buffer several // directory entries per actual read operation; <readdir> marks for // update the st_atime field of the directory each time the diff --git a/ace/Dump.h b/ace/Dump.h index 2f44c2795c3..1bb165d0eb9 100644 --- a/ace/Dump.h +++ b/ace/Dump.h @@ -135,7 +135,8 @@ private: // subobject corresponding to the base class is destroyed (hence // on destruction of the subobject its handle won't exist anymore // and we'll have to check for that). - Tuple() : dumper_(0) {} + + Tuple (void) : dumper_(0) {} }; static ACE_ODB *instance_; diff --git a/ace/Env_Value_T.h b/ace/Env_Value_T.h index 726d1c7b4bb..69da5351c51 100644 --- a/ace/Env_Value_T.h +++ b/ace/Env_Value_T.h @@ -40,7 +40,7 @@ public: ACE_Env_Value (void); // Default constructor which isn't bound to a specific environment // variable name or a default value. Before being useful it must - // <open()>ed. + // <open>'d. ACE_Env_Value (const ASYS_TCHAR *varname, const T &vardefault); diff --git a/ace/Event_Handler.h b/ace/Event_Handler.h index ece9adf8715..410755d24eb 100644 --- a/ace/Event_Handler.h +++ b/ace/Event_Handler.h @@ -125,7 +125,7 @@ public: #if !defined (ACE_HAS_WINCE) static void *read_adapter (void *event_handler); // Used to read from non-socket ACE_HANDLEs in our own thread to - // work around Win32 limitations that don't allow us to select() on + // work around Win32 limitations that don't allow us to <select> on // non-sockets (such as ACE_STDIN). This is commonly used in // situations where the Reactor is used to demultiplex read events // on ACE_STDIN on UNIX. Note that <event_handler> must be a @@ -138,7 +138,7 @@ public: ACE_Thread_Manager *thr_mgr, int flags = THR_DETACHED); // Abstracts away from the differences between Win32 and ACE with - // respect to reading from ACE_STDIN (which is non-select()'able on + // respect to reading from ACE_STDIN (which is non-<select>'able on // Win32. static int remove_stdin_handler (ACE_Reactor *reactor, diff --git a/ace/Filecache.h b/ace/Filecache.h index 8a392c6f290..ff5f8194d47 100644 --- a/ace/Filecache.h +++ b/ace/Filecache.h @@ -143,7 +143,7 @@ private: // A reference to the low level instance. ACE_HANDLE handle_; - // A dup()'d version of the one from this->file_. + // A <dup>'d version of the one from <file_>. int mapit_; }; diff --git a/ace/Free_List.h b/ace/Free_List.h index 44a9ef0e3e0..837e43f1207 100644 --- a/ace/Free_List.h +++ b/ace/Free_List.h @@ -60,9 +60,10 @@ class ACE_Locked_Free_List : public ACE_Free_List<T> // Implements a free list. // // = DESCRIPTION - // This class maintains a free list of nodes of type T. It depends on - // the type T having a get_next () and set_next () method. It maintains - // a mutex so the freelist can be used in a multithreaded program . + // This class maintains a free list of nodes of type T. It + // depends on the type T having a <get_next> and <set_next> + // method. It maintains a mutex so the freelist can be used in + // a multithreaded program . public: // = Initialization and termination. ACE_Locked_Free_List (int mode = ACE_FREE_LIST_WITH_POOL, diff --git a/ace/Functor_T.cpp b/ace/Functor_T.cpp index 42fafc62c74..89e3815df87 100644 --- a/ace/Functor_T.cpp +++ b/ace/Functor_T.cpp @@ -1,33 +1,6 @@ /* -*- C++ -*- */ // $Id$ -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Functor_T.cpp -// -// = DESCRIPTION -// Non-inlinable method definitions for templatized classes -// implementing the GOF Command Pattern, or STL-style functors. -// -// = AUTHOR -// Chris Gill <cdgill@cs.wustl.edu> -// -// Based on Command Pattern implementations originally done by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// and on STL-style functor implementations originally done by -// -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ - #ifndef ACE_FUNCTOR_T_C #define ACE_FUNCTOR_T_C @@ -46,7 +19,6 @@ ACE_RCSID(ace, Functor_T, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Command_Callback) - /////////////////////////////////// // GOF Command Pattern Templates // /////////////////////////////////// @@ -61,6 +33,11 @@ ACE_Command_Callback<RECEIVER, ACTION>::ACE_Command_Callback (RECEIVER &recvr, { } +template <class RECEIVER, class ACTION> +ACE_Command_Callback<RECEIVER, ACTION>::~ACE_Command_Callback (void) +{ +} + // Invokes an operation. template <class RECEIVER, class ACTION> int diff --git a/ace/Functor_T.h b/ace/Functor_T.h index 238cea27650..5cfd4a5601f 100644 --- a/ace/Functor_T.h +++ b/ace/Functor_T.h @@ -10,25 +10,26 @@ // Functor_T.h // // = DESCRIPTION -// Templatized classes for implementing function objects that are used in -// various places in ACE. There are currently two major categories of -// function objects in ACE: GOF Command Pattern objects, and STL-style -// functors for comparison of container elements. The command objects -// are invoked via an execute () method, while the STL-style functors are -// invoked via an operator() () method. +// Templatized classes for implementing function objects that are +// used in various places in ACE. There are currently two major +// categories of function objects in ACE: GOF Command Pattern +// objects, and STL-style functors for comparison of container +// elements. The command objects are invoked via an <execute> +// method, while the STL-style functors are invoked via an +// <operator()> method. // // = AUTHOR -// Chris Gill <cdgill@cs.wustl.edu> +// Chris Gill <cdgill@cs.wustl.edu> // // Based on Command Pattern implementations originally done by // -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> +// Carlos O'Ryan <coryan@cs.wustl.edu>, +// Douglas C. Schmidt <schmidt@cs.wustl.edu>, and +// Sergio Flores-Gaitan <sergio@cs.wustl.edu> // -// and on STL-style functor implementations originally done by +// and on STL-style functor implementations originally done by // -// Irfan Pyarali <irfan@cs.wustl.edu> +// Irfan Pyarali <irfan@cs.wustl.edu> // // ============================================================================ @@ -49,9 +50,9 @@ template <class RECEIVER, class ACTION> class ACE_Command_Callback : public ACE_Command_Base { // = TITLE - // Defines a class template that allows us to invoke a GOF command style - // callback to an object without knowing anything about the object except - // its type. + // Defines a class template that allows us to invoke a GOF + // command style callback to an object without knowing anything + // about the object except its type. // // = DESCRIPTION // This class declares an interface to execute operations, @@ -59,19 +60,17 @@ class ACE_Command_Callback : public ACE_Command_Base // how to implement the operation. A class can invoke operations // without knowing anything about it, or how it was implemented. public: - ACE_Command_Callback (RECEIVER &recvr, ACTION action); // Constructor: sets the <receiver_> of the Command to recvr, and the // <action_> of the Command to <action>. - virtual ~ACE_Command_Callback (void) {} + virtual ~ACE_Command_Callback (void); // Virtual destructor. virtual int execute (void *arg = 0); // Invokes the method <action_> from the object <receiver_>. private: - RECEIVER &receiver_; // Object where the method resides. @@ -87,9 +86,7 @@ template <class TYPE> class ACE_Hash { // = TITLE - // // Function object for hashing - // public: u_long operator () (const TYPE &t) const; // Simply calls t.hash () @@ -99,9 +96,7 @@ template <class TYPE> class ACE_Pointer_Hash { // = TITLE - // // Function object for hashing pointers - // public: u_long operator () (TYPE t) const; // Simply returns t. @@ -111,10 +106,8 @@ template <class TYPE> class ACE_Equal_To { // = TITLE - // // Function object for comparing two objects of // the given type for equality. - // public: int operator () (const TYPE &lhs, const TYPE &rhs) const; @@ -125,10 +118,9 @@ template <class TYPE> class ACE_Less_Than { // = TITLE - // - // Function object for determining whether the first object of the - // given type is less than the second object of the same type. - // + // Function object for determining whether the first object of + // the given type is less than the second object of the same + // type. public: int operator () (const TYPE &lhs, const TYPE &rhs) const; diff --git a/ace/Functor_T.i b/ace/Functor_T.i index 52e38166dac..d626f76ed15 100644 --- a/ace/Functor_T.i +++ b/ace/Functor_T.i @@ -1,38 +1,6 @@ /* -*- C++ -*- */ // $Id$ -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Functor_T.i -// -// = DESCRIPTION -// Inlinable method definitions for templatized classes -// implementing the GOF Command Pattern, or STL-style functors. -// -// = AUTHOR -// Chris Gill <cdgill@cs.wustl.edu> -// -// Based on Command Pattern implementations originally done by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// and on STL-style functor implementations originally done by -// -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ - - -///////////////////////////////// -// STL-style Functor Templates // -///////////////////////////////// - template <class TYPE> ACE_INLINE u_long ACE_Hash<TYPE>::operator () (const TYPE &t) const { @@ -56,5 +24,5 @@ template <class TYPE> ACE_INLINE int ACE_Less_Than<TYPE>::operator () (const TYPE &lhs, const TYPE &rhs) const { - return (lhs < rhs) ? 1 : 0; + return lhs < rhs ? 1 : 0; } diff --git a/ace/Future.h b/ace/Future.h index 184eb08f462..70778d40ac8 100644 --- a/ace/Future.h +++ b/ace/Future.h @@ -290,7 +290,7 @@ public: void dump (void) const; // Dump the state of an object. - ACE_Future_Rep<T> *get_rep (); + ACE_Future_Rep<T> *get_rep (void); // Get the underlying <ACE_Future_Rep>*. Note that this method should // rarely, if ever, be used and that modifying the undlerlying <ACE_Future_Rep>* // should be done with extreme caution. diff --git a/ace/High_Res_Timer.h b/ace/High_Res_Timer.h index 4a591b56503..2829e2b5747 100644 --- a/ace/High_Res_Timer.h +++ b/ace/High_Res_Timer.h @@ -33,9 +33,9 @@ class ACE_Export ACE_High_Res_Timer // = DESCRIPTION // Most of the member functions don't return values. The only // reason that one would fail is if high-resolution time isn't - // supported on the platform. To avoid impacting performance and - // complicating the interface, in that case, ACE_OS::gettimeofday () - // is used instead. + // supported on the platform. To avoid impacting performance + // and complicating the interface, in that case, + // <ACE_OS::gettimeofday> is used instead. // // The global scale factor is required for platforms that have // high-resolution timers that return units other than @@ -44,7 +44,7 @@ class ACE_Export ACE_High_Res_Timer // and is used by all instances of High Res Timer. The member // functions that return or print times use the global scale // factor. They divide the "time" that they get from - // ACE_OS::gethrtime () by global_scale_factor_ to obtain the + // <ACE_OS::gethrtime> by global_scale_factor_ to obtain the // time in microseconds. Its units are therefore 1/microsecond. // On Solaris, a scale factor of 1000 should be used because its // high-resolution timer returns nanoseconds. However, on Intel @@ -56,11 +56,11 @@ class ACE_Export ACE_High_Res_Timer // NOTE: the elapsed time calculations in the print methods use // ACE_hrtime_t values. Those methods do _not_ check for overflow! // - // NOTE: Gabe <begeddov@proaxis.com> raises this issue - // regarding ACE_OS::gethrtime (): on multi-processors, the - // processor that you query for your timer.stop () value might - // not be the one you queried for timer.start (). Its not clear - // how much divergence there would be, if any. + // NOTE: Gabe <begeddov@proaxis.com> raises this issue regarding + // <ACE_OS::gethrtime>: on multi-processors, the processor that + // you query for your <timer.stop> value might not be the one + // you queried for <timer.start>. Its not clear how much + // divergence there would be, if any. // // This issue is not mentioned in the Solaris 2.5.1 gethrtime // man page. @@ -149,8 +149,8 @@ public: void print_total (const char *message, const int iterations = 1, ACE_HANDLE handle = ACE_STDOUT) const; - // Print total time. NOTE: only use print_total () - // if incremental timings had been used! + // Print total time. NOTE: only use <print_total> if incremental + // timings had been used! void print_ave (const char *message, const int iterations = 1, @@ -166,17 +166,17 @@ public: static ACE_Time_Value gettimeofday (const ACE_OS::ACE_HRTimer_Op = ACE_OS::ACE_HRTIMER_GETTIME); - // THIS FUNCTION IS DEPRECATED. PLEASE USE ACE_OS::gettimeofday () - // INSTEAD! - // Calls ACE_High_Res_Timer::hrtime_to_tv passing ACE_OS::gethrtime. - // This function can be used to parameterize objects such as - // ACE_Timer_Queue::gettimeofday. If global_scale_factor_ is not - // set, and we're on a platform that requires global_scale_factor_ - // (e.g., Win32), ACE_OS::gettimeofday will be used instead of - // ACE_OS::gethrtime. This allows applications on Intel to use - // High_Res_Timer even when global_scale_factor is not set. - // However, setting the global_scale_factor_ appropriately will - // result in the finest resolution possible. + // THIS FUNCTION IS DEPRECATED. PLEASE USE <ACE_OS::gettimeofday> + // INSTEAD! Calls <ACE_High_Res_Timer::hrtime_to_tv> passing + // <ACE_OS::gethrtime>. This function can be used to parameterize + // objects such as <ACE_Timer_Queue::gettimeofday>. If + // <global_scale_factor_> is not set, and we're on a platform that + // requires <global_scale_factor_> (e.g., Win32), + // ACE_OS::gettimeofday will be used instead of <ACE_OS::gethrtime>. + // This allows applications on Intel to use <High_Res_Timer> even + // when <global_scale_factor> is not set. However, setting the + // <global_scale_factor_> appropriately will result in the finest + // resolution possible. static void hrtime_to_tv (ACE_Time_Value &tv, const ACE_hrtime_t hrt); @@ -193,9 +193,9 @@ private: static ACE_hrtime_t gettime (const ACE_OS::ACE_HRTimer_Op = ACE_OS::ACE_HRTIMER_GETTIME); // For internal use: gets the high-resolution time using - // ACE_OS::gethrtime (). Except on platforms that require that the - // global_scale_factor_ be set, such as ACE_WIN32, uses the - // low-resolution clock if the global_scale_factor_ has not been + // <ACE_OS::gethrtime>. Except on platforms that require that the + // <global_scale_factor_> be set, such as ACE_WIN32, uses the + // low-resolution clock if the <global_scale_factor_> has not been // set. ACE_hrtime_t start_; diff --git a/ace/IOStream.h b/ace/IOStream.h index 06b992c046e..6bdd07b72a7 100644 --- a/ace/IOStream.h +++ b/ace/IOStream.h @@ -212,7 +212,7 @@ protected: // overflow. void reset_base (void); - // Resets the base() pointer and streambuf mode. This is used + // Resets the <base> pointer and streambuf mode. This is used // internally when get/put buffers are allocatd. protected: @@ -249,11 +249,11 @@ protected: int syncin (void); // syncin is called when the input needs to be synced with the - // source file. In a filebuf, this results in the seek() system + // source file. In a filebuf, this results in the <seek> system // call being used. We can't do that on socket-like connections, so // this does basically nothing. That's safe because we have a // separate read buffer to maintain the already-read data. In a - // filebuf, the single common buffer is used forcing the seek() + // filebuf, the single common buffer is used forcing the <seek> // call. int syncout (void); @@ -304,7 +304,7 @@ protected: } char *ebuf (void) const { - return cur_mode_ == 0 ? 0 : base() + streambuf_size_; + return cur_mode_ == 0 ? 0 : base () + streambuf_size_; } int blen (void) const @@ -341,7 +341,7 @@ typedef ostream& (*__omanip_)(ostream&); // This macro defines the get operator for class MT into datatype DT. // We will use it below to quickly override most (all?) iostream get -// operators. Notice how the ipfx() and isfx() functions are used. +// operators. Notice how the <ipfx> and <isfx> functions are used. #define GET_SIG(MT,DT) inline virtual MT& operator>> (DT v) #if defined (__KCC) @@ -368,7 +368,7 @@ typedef ostream& (*__omanip_)(ostream&); // This macro defines the put operator for class MT into datatype DT. // We will use it below to quickly override most (all?) iostream put -// operators. Notice how the opfx() and osfx() functions are used. +// operators. Notice how the <opfx> and <osfx> functions are used. #define PUT_SIG(MT,DT) inline virtual MT& operator<< (DT v) #if defined (__KCC) @@ -480,8 +480,8 @@ typedef ostream& (*__omanip_)(ostream&); PUT_FUNC_SET0(MT,CODE,CODE2) #endif /* ACE_LACKS_SIGNED_CHAR */ -#define GET_MANIP_CODE { if( ipfx() ) { (*func)(*this); } isfx(); return *this; } -#define PUT_MANIP_CODE { if( opfx() ) { (*func)(*this); } osfx(); return *this; } +#define GET_MANIP_CODE { if (ipfx ()) { (*func) (*this); } isfx (); return *this; } +#define PUT_MANIP_CODE { if (opfx ()) { (*func) (*this); } osfx (); return *this; } #define GET_FUNC_SET(MT) GET_FUNC_SET1(MT,GET_CODE,GET_MANIP_CODE) #define PUT_FUNC_SET(MT) PUT_FUNC_SET1(MT,PUT_CODE,PUT_MANIP_CODE) diff --git a/ace/IOStream_T.h b/ace/IOStream_T.h index 86e0c6bf645..289fe568a60 100644 --- a/ace/IOStream_T.h +++ b/ace/IOStream_T.h @@ -125,9 +125,9 @@ public: int eof (void) const; // Returns 1 if we're at the end of the <STREAM>, i.e., if the // connection has closed down or an error has occurred, else 0. - // Under the covers, eof() calls the streambuf's timeout() function + // Under the covers, <eof> calls the streambuf's <timeout> function // which will reset the timeout flag. As as result, you should save - // the return of eof() and check it instead of calling eof() + // the return of <eof> and check it instead of calling <eof> // successively. #if defined (ACE_HAS_STRING_CLASS) @@ -146,61 +146,63 @@ public: #if defined (ACE_LACKS_IOSTREAM_FX) virtual int ipfx (int noskip = 0) { - if (good()) + if (good ()) { - if (tie() != 0) - tie()->flush(); - if (!noskip && flags() & skipws) + if (tie () != 0) + tie ()->flush (); + if (!noskip && flags () & skipws) { int ch; - while (isspace(ch = rdbuf()->sbumpc())) - ; + while (isspace (ch = rdbuf ()->sbumpc ())) + continue; if (ch != EOF) - rdbuf()->sputbackc(ch); + rdbuf ()->sputbackc (ch); } - if (good()) - return (1); + if (good ()) + return 1; } -#if !defined (ACE_WIN32) /* MS VC++ 5.0 doesn't declare setstate */ - setstate(failbit); +#if !defined (ACE_WIN32) + // MS VC++ 5.0 doesn't declare setstate. + setstate (failbit); #endif /* !ACE_WIN32 */ return (0); } - virtual int ipfx0(void) { return ipfx (0); } // Optimized ipfx(0) - virtual int ipfx1(void) // Optimized ipfx(1) + virtual int ipfx0 (void) { return ipfx (0); } // Optimized ipfx(0) + virtual int ipfx1 (void) // Optimized ipfx(1) { - if (good()) + if (good ()) { - if (tie() != 0) - tie()->flush(); - if (good()) - return (1); + if (tie () != 0) + tie ()->flush (); + if (good ()) + return 1; } -#if !defined (ACE_WIN32) /* MS VC++ 5.0 doesn't declare setstate */ - setstate(failbit); +#if !defined (ACE_WIN32) + // MS VC++ 5.0 doesn't declare setstate. + setstate (failbit); #endif /* !ACE_WIN32 */ return (0); } - virtual void isfx (void) { return; } + virtual void isfx (void) { return; } virtual int opfx (void) { - if (good() && tie() != 0) - tie()->flush(); - return (good()); + if (good () && tie () != 0) + tie ()->flush (); + return good (); } - virtual void osfx (void) { if (flags() & unitbuf) flush(); } + virtual void osfx (void) { if (flags () & unitbuf) flush (); } #else #if defined (__GNUC__) - virtual int ipfx0(void) { return iostream::ipfx0 (); } // Optimized ipfx(0) - virtual int ipfx1(void) { return iostream::ipfx1(); } // Optimized ipfx(1) + virtual int ipfx0 (void) { return iostream::ipfx0 (); } // Optimized ipfx(0) + virtual int ipfx1 (void) { return iostream::ipfx1 (); } // Optimized ipfx(1) #else - virtual int ipfx0(void) { return iostream::ipfx (0); } - virtual int ipfx1(void) { return iostream::ipfx (1); } + virtual int ipfx0 (void) { return iostream::ipfx (0); } + virtual int ipfx1 (void) { return iostream::ipfx (1); } #endif /* __GNUC__ */ virtual int ipfx (int need = 0) { return iostream::ipfx (need); } - virtual void isfx (void) { iostream::isfx (); return; } + virtual void isfx (void) { iostream::isfx (); } virtual int opfx (void) { return iostream::opfx (); } - virtual void osfx (void) { iostream::osfx (); return; } + virtual void osfx (void) { iostream::osfx (); } #endif /* ACE_LACKS_IOSTREAM_FX */ ACE_IOStream<STREAM> & operator>> (ACE_Time_Value *&tv); diff --git a/ace/Local_Tokens.h b/ace/Local_Tokens.h index e797f5b7ee9..1e777ddafdc 100644 --- a/ace/Local_Tokens.h +++ b/ace/Local_Tokens.h @@ -467,11 +467,11 @@ public: virtual int acquire (ACE_TPQ_Entry *caller, int ignore_deadlock, int notify); - // Returns 0 on success, -1 on failure with ACE_LOG_MSG->errnum() as + // Returns 0 on success, -1 on failure with <ACE_Log_Msg::errnum> as // the reason. If errnum == EWOULDBLOCK, and notify == 1, - // ACE_Token_Proxy::sleep_hook() has been called on the current owner - // of the token. If ignore_deadlock is passed as 1 and errnum == - // EDEADLK, then deadlock was detected via ace_token_manager. + // <ACE_Token_Proxy::sleep_hook> has been called on the current + // owner of the token. If ignore_deadlock is passed as 1 and errnum + // == EDEADLK, then deadlock was detected via ace_token_manager. virtual int tryacquire (ACE_TPQ_Entry *caller); // same as acquire, but fails if would block @@ -491,11 +491,11 @@ public: // waiting threads it will give up the token even if the // nesting_level_ > 1. I'm not sure if this is really the right // thing to do (since it makes it possible for shared data to be - // changed unexpectedly) so use with caution... - // Returns 0 on success, -1 on failure with ACE_LOG_MSG->errnum() as - // the reason. If errnum == EWOULDBLOCK, and notify == 1, - // ACE_Token_Proxy::sleep_hook() has been called on the current owner - // of the token. + // changed unexpectedly) so use with caution... Returns 0 on + // success, -1 on failure with <ACE_Log_Msg::errnum> as the reason. + // If errnum == EWOULDBLOCK, and notify == 1, + // <ACE_Token_Proxy::sleep_hook> has been called on the current + // owner of the token. virtual int release (ACE_TPQ_Entry *caller); // Relinquish the token. If there are any waiters then the next one @@ -555,11 +555,11 @@ public: virtual int acquire (ACE_TPQ_Entry *caller, int ignore_deadlock, int notify); - // Returns 0 on success, -1 on failure with ACE_LOG_MSG->errnum() as + // Returns 0 on success, -1 on failure with <ACE_Log_Msg::errnum> as // the reason. If errnum == EWOULDBLOCK, and notify == 1, - // ACE_Token_Proxy::sleep_hook() has been called on the current owner - // of the token. If ignore_deadlock is passed as 1 and errnum == - // EDEADLK, then deadlock was detected via ace_token_manager. + // <ACE_Token_Proxy::sleep_hook> has been called on the current + // owner of the token. If ignore_deadlock is passed as 1 and errnum + // == EDEADLK, then deadlock was detected via ace_token_manager. virtual int tryacquire (ACE_TPQ_Entry *caller); // same as acquire except fails on would block @@ -579,11 +579,11 @@ public: // waiting threads it will give up the token even if the // nesting_level_ > 1. I'm not sure if this is really the right // thing to do (since it makes it possible for shared data to be - // changed unexpectedly) so use with caution... - // Returns 0 on success, -1 on failure with ACE_LOG_MSG->errnum() as - // the reason. If errnum == EWOULDBLOCK, and notify == 1, - // ACE_Token_Proxy::sleep_hook() has been called on the current owner - // of the token. + // changed unexpectedly) so use with caution... Returns 0 on + // success, -1 on failure with <ACE_Log_Msg::errnum> as the reason. + // If errnum == EWOULDBLOCK, and notify == 1, + // <ACE_Token_Proxy::sleep_hook> has been called on the current + // owner of the token. virtual int release (ACE_TPQ_Entry *caller); // Relinquish the token. If there are any waiters then the next one @@ -683,7 +683,7 @@ class ACE_Export ACE_Token_Proxy // changed. See ACE_Token_Manager for details. // // Tokens (e.g. ACE_Mutex_Token) assume that it can always call - // ACE_Token_Proxy::token_acquired () on a new token owner. This + // <ACE_Token_Proxy::token_acquired> on a new token owner. This // is not a problem for synchronous use of token proxies (that is, // when acquires block until successful.) However, for // implementations of the Token Server, which may use asynch @@ -781,9 +781,9 @@ public: // called "Reactor Token." virtual void sleep_hook (void); - // This should really be called someone_waiting (). - // This is called by ACE_Token_xx's when another proxy enters the - // waiting list and requests that the current token holder be notified. + // This should really be called <someone_waiting>. This is called + // by ACE_Token_xx's when another proxy enters the waiting list and + // requests that the current token holder be notified. virtual void token_acquired (ACE_TPQ_Entry *); // This is called when a queued (waiting) proxy is removed from the diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h index b74b2afaf2c..a6506eeab33 100644 --- a/ace/Log_Msg.h +++ b/ace/Log_Msg.h @@ -113,16 +113,16 @@ class ACE_Export ACE_Log_Msg_Callback // Log_Msg class and make sure that they turn on the // ACE_Log_Msg::MSG_CALLBACK flag. // - // Your log() routine is called with an instance of + // Your <log> routine is called with an instance of // ACE_Log_Record. From this class, you can get the log // message, the verbose log message, message type, message // priority, and so on. // // Remember that there is one Log_Msg object per thread. // Therefore, you may need to register your callback object with - // many Log_Msg objects (and have the correct synchronization in - // the log() method) or have a separate callback object per - // Log_Msg object. + // many <ACE_Log_Msg> objects (and have the correct + // synchronization in the <log> method) or have a separate + // callback object per Log_Msg object. public: virtual ~ACE_Log_Msg_Callback (void); // No-op virtual destructor. diff --git a/ace/Malloc.cpp b/ace/Malloc.cpp index 6989ce2a4f6..d06ba145f31 100644 --- a/ace/Malloc.cpp +++ b/ace/Malloc.cpp @@ -41,13 +41,19 @@ ACE_Name_Node::ACE_Name_Node (void) } ACE_Name_Node::ACE_Name_Node (const char *name, - char *ptr, + char *name_ptr, + char *pointer, ACE_Name_Node *next) - : pointer_ (ptr), + : name_ (name_ptr), + pointer_ (pointer), next_ (next) { ACE_TRACE ("ACE_Name_Node::ACE_Name_Node"); - ACE_OS::strcpy (ACE_POINTER_CAST (this->name_), name); + char *n = ACE_POINTER_CAST (this->name_); + ACE_DEBUG ((LM_DEBUG, + "****** this->name_ = %x\n", n)); + ACE_OS::strcpy (n, name); + this->dump (); } ACE_Name_Node::ACE_Name_Node (const ACE_Name_Node &) @@ -59,6 +65,7 @@ ACE_Name_Node::ACE_Name_Node (const ACE_Name_Node &) const char * ACE_Name_Node::name (void) const { + this->dump (); return ACE_POINTER_CAST (this->name_); } @@ -76,7 +83,7 @@ ACE_Name_Node::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("pointer = %x"), ACE_POINTER_CAST (this->pointer_))); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("\nnext_ = %x"), ACE_POINTER_CAST (this->next_))); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("\nname_ = %s"), ACE_POINTER_CAST (this->name_))); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("\nname_ = (%x, %s)"), ACE_POINTER_CAST (this->name_), ACE_POINTER_CAST (this->name_))); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("\n"))); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } diff --git a/ace/Malloc.h b/ace/Malloc.h index 7844a8079a3..e1a6c6408c6 100644 --- a/ace/Malloc.h +++ b/ace/Malloc.h @@ -121,8 +121,9 @@ class ACE_Export ACE_Name_Node public: // = Initialization methods. ACE_Name_Node (const char *name, - char *, - ACE_Name_Node *); + char *name_ptr, + char *pointer, + ACE_Name_Node *head); // Constructor. ACE_Name_Node (const ACE_Name_Node &); @@ -200,7 +201,7 @@ public: + MAXNAMELEN)) #endif /* ACE_HAS_MALLOC_STATS */ -// Notice the casting to int for sizeof() otherwise unsigned int +// Notice the casting to int for <sizeof> otherwise unsigned int // arithmetic is used and some awful things may happen. #define ACE_CONTROL_BLOCK_ALIGN_LONGS ((ACE_CONTROL_BLOCK_SIZE % ACE_MALLOC_PADDING != 0 \ ? ACE_MALLOC_PADDING - (ACE_CONTROL_BLOCK_SIZE) \ @@ -210,7 +211,7 @@ public: // Force alignment. ACE_Malloc_Header base_; - // Dummy node used to anchor the freelist. + // Dummy node used to anchor the freelist. This needs to come last... void dump (void) const; // Dump the state of the object. @@ -251,8 +252,8 @@ public: virtual void dump (void) const; private: - // DO NOT ADD ANY STATE (DATA MEMBERS) TO THIS CLASS!!!! - // See the ACE_Allocator::instance () implementation for explanation. + // DO NOT ADD ANY STATE (DATA MEMBERS) TO THIS CLASS!!!! See the + // <ACE_Allocator::instance> implementation for explanation. }; class ACE_Export ACE_Static_Allocator_Base : public ACE_Allocator diff --git a/ace/Malloc_Base.h b/ace/Malloc_Base.h index f2a40868cd2..2d4f95c2a89 100644 --- a/ace/Malloc_Base.h +++ b/ace/Malloc_Base.h @@ -121,8 +121,8 @@ public: virtual void dump (void) const = 0; // Dump the state of the object. private: - // DO NOT ADD ANY STATE (DATA MEMBERS) TO THIS CLASS!!!! - // See the ACE_Allocator::instance () implementation for explanation. + // DO NOT ADD ANY STATE (DATA MEMBERS) TO THIS CLASS!!!! See the + // <ACE_Allocator::instance> implementation for explanation. static ACE_Allocator *allocator_; // Pointer to a process-wide <ACE_Allocator> instance. diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp index 8d3ba28d10f..3f760050910 100644 --- a/ace/Malloc_T.cpp +++ b/ace/Malloc_T.cpp @@ -479,19 +479,17 @@ ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind (const char *name, (ACE_Name_Node *) this->shared_malloc (sizeof (ACE_Name_Node) + ACE_OS::strlen (name) + 1), -1); - - // This is a clever trick that skips over the <ACE_Name_Node> chunk - // and points to where the string name goes. - new_node->name_ = (char *) (new_node + 1); - - // Insert new node at the head of the list. Note that (new_node) is - // *not* a cast, it's operator placement new. - ACE_NEW_RETURN (this->cb_ptr_->name_head_, - (new_node) ACE_Name_Node (name, - ACE_reinterpret_cast (char *, - pointer), - ACE_POINTER_CAST (this->cb_ptr_->name_head_)), - -1); + char *name_ptr = (char *) (new_node + 1); + + // Use operator placement new to insert <new_node> at the head of + // the linked list of <ACE_Name_Node>s. + ACE_Name_Node *result = + new (new_node) ACE_Name_Node (name, + name_ptr, + ACE_reinterpret_cast (char *, + pointer), + ACE_POINTER_CAST (this->cb_ptr_->name_head_)); + this->cb_ptr_->name_head_ = result; return 0; } diff --git a/ace/Managed_Object.h b/ace/Managed_Object.h index 01556585db4..b14ca2cf820 100644 --- a/ace/Managed_Object.h +++ b/ace/Managed_Object.h @@ -75,7 +75,7 @@ class ACE_Managed_Object // until needed, but should be allocated when first needed. And // they are destroyed in the reverse order of construction. // - // get_preallocated_object () accesses a "preallocated" object, + // <get_preallocated_object> accesses a "preallocated" object, // i.e., one that is identified by a value in the // ACE_Object_Manager:: Preallocated_Object enum. These objects // are used internally by the ACE library. @@ -136,7 +136,7 @@ public: private: // Disallow instantiation of this class. - ACE_UNIMPLEMENTED_FUNC (ACE_Managed_Object ()) + ACE_UNIMPLEMENTED_FUNC (ACE_Managed_Object (void)) ACE_UNIMPLEMENTED_FUNC (ACE_Managed_Object (const ACE_Managed_Object<TYPE> &)) ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Managed_Object<TYPE> &)) diff --git a/ace/Map_T.h b/ace/Map_T.h index 2b9e2594a72..88b35feef50 100644 --- a/ace/Map_T.h +++ b/ace/Map_T.h @@ -34,7 +34,7 @@ class ACE_Noop_Key_Generator // Defines a noop key generator. public: - int operator() (T &); + int operator () (T &); // Functor method: generates a new key. }; @@ -59,7 +59,7 @@ public: ACE_Incremental_Key_Generator (void); // Constructor. - int operator() (T &t); + int operator () (T &t); // Functor method: generates a new key. T& current_value (void); @@ -90,7 +90,7 @@ public: virtual int compare (const ACE_Iterator_Impl<T> &rhs) const = 0; // Comparison. - virtual T dereference () const = 0; + virtual T dereference (void) const = 0; // Dereference. virtual void plus_plus (void) = 0; @@ -119,7 +119,7 @@ public: virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const = 0; // Comparison. - virtual T dereference () const = 0; + virtual T dereference (void) const = 0; // Dereference. virtual void plus_plus (void) = 0; @@ -159,7 +159,7 @@ public: int operator!= (const ACE_Iterator<T> &rhs) const; // Comparison operators. - T operator* () const; + T operator *() const; // Dereference operator. ACE_Iterator<T> &operator++ (void); @@ -213,7 +213,7 @@ public: int operator!= (const ACE_Reverse_Iterator<T> &rhs) const; // Comparison operators. - T operator* () const; + T operator *() const; // Dereference operator. ACE_Reverse_Iterator<T> &operator++ (void); @@ -427,7 +427,7 @@ public: virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -471,7 +471,7 @@ public: virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -676,7 +676,7 @@ public: virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -720,7 +720,7 @@ public: virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -940,7 +940,7 @@ public: virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -984,7 +984,7 @@ public: virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -1194,7 +1194,7 @@ public: virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); @@ -1238,7 +1238,7 @@ public: virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; // Comparison. - virtual T dereference () const; + virtual T dereference (void) const; // Dereference. virtual void plus_plus (void); diff --git a/ace/Memory_Pool.h b/ace/Memory_Pool.h index 78fdd72a966..83523ec9aab 100644 --- a/ace/Memory_Pool.h +++ b/ace/Memory_Pool.h @@ -193,7 +193,7 @@ protected: virtual int commit_backing_store_name (size_t rounded_bytes, off_t &offset); // Commits a new shared memory segment if necessary after an - // acquire() or a signal. <offset> is set to the new offset into + // <acquire> or a signal. <offset> is set to the new offset into // the backing store. // = Keeps track of all the segments being used. @@ -487,7 +487,7 @@ class ACE_Export ACE_Lite_MMAP_Memory_Pool : public ACE_MMAP_Memory_Pool // = DESCRIPTION // This implementation allows memory to be shared between // processes. However, unlike the <ACE_MMAP_Memory_Pool> - // the sync() methods are no-ops, which means that we don't pay + // the <sync> methods are no-ops, which means that we don't pay // for the price of flushing the memory to the backing store on // every update. Naturally, this trades off increased // performance for less reliability if the machine crashes. diff --git a/ace/Message_Block.h b/ace/Message_Block.h index 802787ed1e6..4bd906b9e46 100644 --- a/ace/Message_Block.h +++ b/ace/Message_Block.h @@ -182,8 +182,8 @@ public: virtual ~ACE_Message_Block (void); // Delete all the resources held in the message. // - // Note that release() is designed to release the continuation - // chain; the destructor is not. See release() for details. + // Note that <release> is designed to release the continuation + // chain; the destructor is not. See <release> for details. // = Message Type accessors and mutators. @@ -251,9 +251,9 @@ public: // In all cases, this ACE_Message_Block is deleted - it must have come // from the heap, or there will be trouble. // - // release() is designed to release the continuation chain; the + // <release> is designed to release the continuation chain; the // destructor is not. If we make the destructor release the - // continuation chain by calling release() or delete on the message + // continuation chain by calling <release> or delete on the message // blocks in the continuation chain, the following code will not // work since the message block in the continuation chain is not off // the heap: @@ -263,7 +263,7 @@ public: // // mb1.cont (&mb2); // - // And hence, call release() on a dynamically allocated message + // And hence, call <release> on a dynamically allocated message // block. This will release all the message blocks in the // continuation chain. If you call delete or let the message block // fall off the stack, cleanup of the message blocks in the @@ -285,7 +285,7 @@ public: // <wr_ptr>. int copy (const char *buf); - // Copies <buf> into the Message_Block starting at the wr_ptr() + // Copies <buf> into the Message_Block starting at the <wr_ptr> // offset. This call assumees that <buf> is NUL-terminated. Return // 0 and increment <wr_ptr> by <ACE_OS::strlen (buf) + 1> if the // method succeeds. Returns -1 if the size of the message is too @@ -317,7 +317,7 @@ public: // Set the write pointer ahead <n> bytes. This is used to compute // the <length> of a message. - // = Message length is wr_ptr() - rd_ptr (). + // = Message length is <wr_ptr> - <rd_ptr>. size_t length (void) const; // Get the length of the message void length (size_t n); @@ -658,11 +658,11 @@ public: u_long dynamic_priority_offset); // ctor - virtual ~ACE_Dynamic_Message_Strategy (); + virtual ~ACE_Dynamic_Message_Strategy (void); // virtual dtor - Priority_Status priority_status (ACE_Message_Block & mb, - const ACE_Time_Value & tv); + Priority_Status priority_status (ACE_Message_Block &mb, + const ACE_Time_Value &tv); // Updates the message's priority and returns its priority status. u_long static_bit_field_mask (void); diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h index b251e62cd0d..2b1a8f78243 100644 --- a/ace/Message_Queue.h +++ b/ace/Message_Queue.h @@ -48,9 +48,9 @@ public: DEFAULT_LWM = 16 * 1024, // Default low watermark (same as high water mark). WAS_ACTIVE = 1, - // Message queue was active before activate() or deactivate(). + // Message queue was active before <activate> or <deactivate>. WAS_INACTIVE = 2 - // Message queue was inactive before activate() or deactivate(). + // Message queue was inactive before <activate> or <deactivate>. }; ACE_Message_Queue_Base (void); @@ -233,7 +233,10 @@ protected: virtual int is_empty_i (void); // True if queue is empty, else false. - // = Implementation of the public activate() and deactivate() methods above (assumes locks are held). + // = Implementation of public <activate>/<deactivate> methods above. + + // These methods assume locks are held. + virtual int deactivate_i (void); // Deactivate the queue. virtual int activate_i (void); @@ -289,12 +292,12 @@ class ACE_Export ACE_Message_Queue_NT : public ACE_Message_Queue_Base // // NOTE: *Many* ACE_Message_Queue features are not supported with // this implementation, including: - // * open method have different signatures. - // * dequeue_head () *requires* that the ACE_Message_Block - // pointer argument point to an ACE_Message_Block that was + // * <open> method have different signatures. + // * <dequeue_head> *requires* that the <ACE_Message_Block> + // pointer argument point to an <ACE_Message_Block> that was // allocated by the caller. - // * peek_dequeue_head (). - // * ACE_Message_Queue_Iterators. + // * <peek_dequeue_head>. + // * <ACE_Message_Queue_Iterators>. // * No flow control. public: // = Initialization and termination methods. diff --git a/ace/Module.h b/ace/Module.h index c32d41ef5f4..45463b93a05 100644 --- a/ace/Module.h +++ b/ace/Module.h @@ -38,16 +38,16 @@ public: enum { M_DELETE_NONE = 0, - // Indicates that close() should not delete any Tasks. + // Indicates that <close> should not delete any Tasks. M_DELETE_READER = 1, - // Indicates that close() should delete the writer Task. + // Indicates that <close> should delete the writer Task. M_DELETE_WRITER = 2, - // Indicates that close() should delete the reader Task. + // Indicates that <close> should delete the reader Task. M_DELETE = 3 - // Indicates that close() deletes the Tasks. Don't change this + // Indicates that <close> deletes the Tasks. Don't change this // value without updating the same enum in class ACE_Stream... // The <M_DELETE_READER> and <M_DELETE_WRITER> flags may be or'ed // together. @@ -93,14 +93,14 @@ public: // and <reader> and <writer> as its tasks. Previously register // reader or writers or closed down and deleted according to the // value of flags_. Should not be called from within - // ACE_Task::module_closed(). + // <ACE_Task::module_closed>. int close (int flags = M_DELETE_NONE); // Close down the Module and its Tasks. The flags argument can be // used to override the default behaviour, which depends on previous - // <flags> values in calls to c'tor(), open(), reader() and - // writer(). A previous value M_DELETE[_XXX] can not be overridden. - // Should not be called from within ACE_Task::module_closed(). + // <flags> values in calls to c'tor, <open>, <reader>, and <writer>. + // A previous value M_DELETE[_XXX] can not be overridden. Should + // not be called from within <ACE_Task::module_closed>. // = ACE_Task manipulation routines ACE_Task<ACE_SYNCH_USE> *writer (void); @@ -111,7 +111,7 @@ public: // module should delete the writer during a call to close or to the // destructor. If a previous writer exists, it is closed. It may // also be deleted, depending on the old flags_ value. Should not - // be called from within ACE_Task::module_closed(). + // be called from within <ACE_Task::module_closed>. ACE_Task<ACE_SYNCH_USE> *reader (void); // Get the reader task. @@ -121,7 +121,7 @@ public: // module should delete the reader during a call to close or to the // destructor. If a previous reader exists, it is closed. It may // also be deleted, depending on the old flags_ value. Should not - // be called from within ACE_Task::module_closed() + // be called from within <ACE_Task::module_closed>. ACE_Task<ACE_SYNCH_USE> *sibling (ACE_Task<ACE_SYNCH_USE> *orig); // Set and get pointer to sibling <ACE_Task> in an <ACE_Module> diff --git a/ace/NT_Service.h b/ace/NT_Service.h index c266454568e..ed43e3668d8 100644 --- a/ace/NT_Service.h +++ b/ace/NT_Service.h @@ -110,8 +110,9 @@ public: // = Functions to operate the service virtual int open (void *args = 0); - // Hook called to open the service. By default, will set the status to - // START_PENDING, svc(), wait(), then set the status to STOPPED. + // Hook called to open the service. By default, will set the status + // to <START>_PENDING, <svc>, <wait>, then set the status to + // STOPPED. virtual int svc (void); // The actual service implementation. This function need not be overridden @@ -121,12 +122,12 @@ public: virtual void handle_control (DWORD control_code); // This function is called in response to a request from the Service - // Dispatcher. It must interact with the svc() function to effect the + // Dispatcher. It must interact with the <svc> function to effect the // requested control operation. The default implementation handles // all requests as follows: // SERVICE_CONTROL_STOP: set stop pending, set cancel flag - // SERVICE_CONTROL_PAUSE: set pause pending, suspend(), set paused - // SERVICE_CONTROL_CONTINUE: set continue pending, resume(), set running + // SERVICE_CONTROL_PAUSE: set pause pending, <suspend>, set paused + // SERVICE_CONTROL_CONTINUE: set continue pending, <resume>, set running // SERVICE_CONTROL_INTERROGATE: reports current status // SERVICE_CONTROL_SHUTDOWN: same as SERVICE_CONTROL_STOP. @@ -238,7 +239,7 @@ public: // service state values are all greater than 0. int state (DWORD *pstate, ACE_Time_Value *wait_hint = 0); - // A version of state() which returns -1 for failure, 0 for success. + // A version of <state> that returns -1 for failure, 0 for success. // The DWORD pointed to by pstate receives the state value. int test_access (DWORD desired_access = SERVICE_ALL_ACCESS); @@ -271,16 +272,16 @@ protected: // wait after that. virtual void stop_requested (DWORD control_code); - // Called by handle_control () when a stop/shutdown was requested. + // Called by <handle_control> when a stop/shutdown was requested. virtual void pause_requested (DWORD control_code); - // Called by handle_control () when a pause was requested. + // Called by <handle_control> when a pause was requested. virtual void continue_requested (DWORD control_code); - // Called by handle_control () when a continue was requested. + // Called by <handle_control> when a continue was requested. virtual void interrogate_requested (DWORD control_code); - // Called by handle_control () when a interrogate was requested. + // Called by <handle_control> when a interrogate was requested. protected: DWORD start_time_; // Estimate of init time needed diff --git a/ace/Naming_Context.h b/ace/Naming_Context.h index 1067635cb82..4484c10c1f0 100644 --- a/ace/Naming_Context.h +++ b/ace/Naming_Context.h @@ -221,7 +221,7 @@ public: // means the types must begin with the pattern string. Returns the // complete binding associated each pattern match. - void dump (); + void dump (void); // Dump the state of the object. private: @@ -26,6 +26,12 @@ # pragma once # endif /* ACE_LACKS_PRAGMA_ONCE */ +# if defined (ACE_HAS_PHARLAP_RT) +#define ACE_IPPROTO_TCP SOL_SOCKET +# else +#define ACE_IPPROTO_TCP IPPROTO_TCP; +# endif /* ACE_HAS_PHARLAP_RT */ + #if !defined (ACE_MALLOC_ALIGN) #define ACE_MALLOC_ALIGN ((int) sizeof (long)) #endif /* ACE_MALLOC_ALIGN */ @@ -316,7 +322,7 @@ enum ACE_Recyclable_State # define ACE_DEFAULT_THR_PORT 10004 # endif /* ACE_DEFAULT_THR_PORT */ -// Used for SOCK_Connect::connect() tests +// Used for <SOCK_Connect::connect> tests # if !defined (ACE_DEFAULT_LOCAL_PORT) # define ACE_DEFAULT_LOCAL_PORT 10005 # endif /* ACE_DEFAULT_LOCAL_PORT */ diff --git a/ace/Object_Manager.h b/ace/Object_Manager.h index 46c55d46a9a..f9b6db943d9 100644 --- a/ace/Object_Manager.h +++ b/ace/Object_Manager.h @@ -153,35 +153,35 @@ class ACE_Export ACE_Object_Manager : public ACE_Object_Manager_Base // late. The ACE tests do not violate this requirement. // However, applications may have trouble with it. // - // NOTE on the use of ::exit (): ::exit () does not destroy + // NOTE on the use of <::exit> -- <::exit> does not destroy // static objects. Therefore, if // ACE_HAS_NONSTATIC_OBJECT_MANAGER is enabled, the - // ACE_Object_Manager instance will *not* be destroyed if ::exit - // () is called! However, ACE_OS::exit () will properly destroy - // the ACE_Object_Manager. It is highly recommended that - // ACE_OS::exit () be used instead of ::exit (). + // <ACE_Object_Manager> instance will *not* be destroyed if + // <::exit> is called! However, <ACE_OS::exit> will properly + // destroy the ACE_Object_Manager. It is highly recommended + // that <ACE_OS::exit> be used instead of <::exit>. // - // However, ::exit () and ACE_OS::exit () are tricky to use + // However, <::exit> and <ACE_OS::exit> are tricky to use // properly, especially in multithread programs. It is much // safer to throw an exception (or simulate that effect) that - // will be caught by main () instead of calling exit. Then, - // main () can perform any necessary application-specific - // cleanup and return the status value. In addition, it's - // usually best to avoid calling ::exit () and ACE_OS::exit () - // from threads other than the main thread. Thanks to Jeff - // Greif <jmg@trivida.com> for pointing out that ::exit () - // doesn't destroy automatic objects, and for developing the + // will be caught by <main> instead of calling exit. Then, + // <main> can perform any necessary application-specific cleanup + // and return the status value. In addition, it's usually best + // to avoid calling <::exit> and <ACE_OS::exit> from threads + // other than the main thread. Thanks to Jeff Greif + // <jmg@trivida.com> for pointing out that <::exit> doesn't + // destroy automatic objects, and for developing the // recommendations in this paragraph. // - // Instead of creating a static ACE_Object_Manager, or letting - // ACE create it on the stack of main () for you, another + // Instead of creating a static <ACE_Object_Manager>, or letting + // ACE create it on the stack of <main> for you, another // alternative is to #define // ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER. With that // #define, the application must create the ACE_Object_Manager. - // The recommended way is to call ACE::init () at the start of - // the program, and call ACE::fini () at the end. - // Alternatively, the application could explicity construct an - // ACE_Object_Manager. + // The recommended way is to call <ACE::init> at the start of + // the program, and call <ACE::fini> at the end. Alternatively, + // the application could explicity construct an + // <ACE_Object_Manager>. public: virtual int init (void); @@ -211,15 +211,14 @@ public: // ACE_HAS_NONSTATIC_OBJECT_MANAGER is not defined.) static int at_exit (ACE_Cleanup *object, void *param = 0); - // Register an ACE_Cleanup object for cleanup at process termination. - // The object is deleted via the ace_cleanup_destroyer (). If you - // need more flexiblity, see the other at_exit () method below. For - // OS's that do not have processes, cleanup takes place at the end of - // main (). Returns 0 on success. On failure, returns -1 and sets - // errno to: - // EAGAIN if shutting down, - // ENOMEM if insufficient virtual memory, or - // EEXIST if the object (or array) had already been registered. + // Register an ACE_Cleanup object for cleanup at process + // termination. The object is deleted via the + // <ace_cleanup_destroyer>. If you need more flexiblity, see the + // <other at_exit> method below. For OS's that do not have + // processes, cleanup takes place at the end of <main>. Returns 0 + // on success. On failure, returns -1 and sets errno to: EAGAIN if + // shutting down, ENOMEM if insufficient virtual memory, or EEXIST + // if the object (or array) had already been registered. static int at_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, @@ -232,17 +231,16 @@ public: // "cleanup_hook" function; the first parameter is the object (or // array) to be destroyed. "cleanup_hook", for example, may delete // the object (or array). For OS's that do not have processes, this - // function is the same as at_thread_exit (). Returns 0 on success. - // On failure, returns -1 and sets errno to: - // EAGAIN if shutting down, - // ENOMEM if insufficient virtual memory, or - // EEXIST if the object (or array) had already been registered. + // function is the same as <at_thread_exit>. Returns 0 on success. + // On failure, returns -1 and sets errno to: EAGAIN if shutting + // down, ENOMEM if insufficient virtual memory, or EEXIST if the + // object (or array) had already been registered. #if 0 /* not implemented yet */ static int at_thread_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param); - // Similar to at_exit (), except that the cleanup_hook is called + // Similar to <at_exit>, except that the cleanup_hook is called // when the current thread exits instead of when the program terminates. #endif /* 0 */ @@ -361,7 +359,7 @@ public: public: // Application code should not use these explicitly, so they're // hidden here. They're public so that the ACE_Object_Manager can - // be constructed/destructed in main () with + // be constructed/destructed in <main> with // ACE_HAS_NONSTATIC_OBJECT_MANAGER. ACE_Object_Manager (void); ~ACE_Object_Manager (void); diff --git a/ace/Pipe.cpp b/ace/Pipe.cpp index d741da94a98..8291c253765 100644 --- a/ace/Pipe.cpp +++ b/ace/Pipe.cpp @@ -23,7 +23,7 @@ ACE_Pipe::dump (void) const } int -ACE_Pipe::open (void) +ACE_Pipe::open (int buffer_size) { ACE_TRACE ("ACE_Pipe::open"); #if defined (ACE_WIN32) || defined (ACE_LACKS_SOCKETPAIR) @@ -64,20 +64,34 @@ ACE_Pipe::open (void) // Make sure that the TCP stack doesn't try to buffer small writes. // Since this communication is purely local to the host it doesn't // affect network performance. -# if defined (ACE_HAS_PHARLAP_RT) - int level = SOL_SOCKET; -# else - int level = IPPROTO_TCP; -# endif /* ACE_HAS_PHARLAP_RT */ - if (writer.set_option (level, TCP_NODELAY, - &one, sizeof one) == -1) + + if (writer.set_option (ACE_IPPROTO_TCP, + TCP_NODELAY, + &one, + sizeof one) == -1) return -1; #endif /* ! ACE_LACKS_TCP_NODELAY */ +#if !defined (ACE_LACKS_SOCKET_BUFSIZ) + if (reader.set_option (SOL_SOCKET, + SO_SNDBUF, + ACE_reinterpret_cast (void *, &buffer_size), + sizeof (buffer_size)) == -1 + && errno != ENOTSUP) + return -1; + else if (writer.set_option (SOL_SOCKET, + SO_RCVBUF, + ACE_reinterpret_cast (void *, &buffer_size), + sizeof (buffer_size)) == -1 + && errno != ENOTSUP) + return -1; +#endif /* !ACE_LACKS_SOCKET_BUFSIZ */ + this->handles_[0] = reader.get_handle (); this->handles_[1] = writer.get_handle (); #elif defined (ACE_HAS_STREAM_PIPES) + ACE_UNUSED_ARG (buffer_size); if (ACE_OS::pipe (this->handles_) == -1) ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), @@ -87,8 +101,12 @@ ACE_Pipe::open (void) // Enable "msg no discard" mode, which ensures that record // boundaries are maintained when messages are sent and received. - if (ACE_OS::ioctl (this->handles_[0], I_SRDOPT, (void *) arg) == -1 - || ACE_OS::ioctl (this->handles_[1], I_SRDOPT, (void *) arg) == -1) + if (ACE_OS::ioctl (this->handles_[0], + I_SRDOPT, + (void *) arg) == -1 + || ACE_OS::ioctl (this->handles_[1], + I_SRDOPT, + (void *) arg) == -1) ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ioctl")), -1); @@ -101,6 +119,22 @@ ACE_Pipe::open (void) ASYS_TEXT ("%p\n"), ASYS_TEXT ("socketpair")), -1); +#if !defined (ACE_LACKS_SOCKET_BUFSIZ) + if (ACE_OS::setsockopt (this->handles_[0], + SOL_SOCKET, + SO_RCVBUF, + ACE_reinterpret_cast (void *, &buffer_size), + sizeof (buffer_size)) == -1 + && errno != ENOTSUP) + return -1; + if (ACE_OS::setsockopt (this->handles_[1], + SOL_SOCKET, + SO_SNDBUF, + ACE_reinterpret_cast (void *, &buffer_size), + sizeof (buffer_size)) == -1 + && errno != ENOTSUP) + return -1; +#endif /* !ACE_LACKS_SOCKET_BUFSIZ */ #endif /* ACE_WIN32 */ // Point both the read and write HANDLES to the appropriate socket // HANDLEs. diff --git a/ace/Pipe.h b/ace/Pipe.h index 8fa5cd5ce47..6f2604391ff 100644 --- a/ace/Pipe.h +++ b/ace/Pipe.h @@ -49,8 +49,8 @@ public: int open (ACE_HANDLE handles[2]); // Open the pipe and initialize the handles. - int open (void); - // Open the pipe. + int open (int buffer_size = ACE_DEFAULT_MAX_SOCKET_BUFSIZ); + // Open the pipe, setting the buffer size to the maximum. int close (void); // Close down the pipe HANDLEs; @@ -76,6 +76,6 @@ private: #if !defined (ACE_LACKS_INLINE_FUNCTIONS) #include "ace/Pipe.i" -#endif +#endif /* ACE_LACKS_INLINE_FUNCTIONS */ #endif /* ACE_PIPE_H */ diff --git a/ace/RB_Tree.h b/ace/RB_Tree.h index f75160d9a01..3b505fd34ac 100644 --- a/ace/RB_Tree.h +++ b/ace/RB_Tree.h @@ -617,7 +617,7 @@ public: int is_done (void); // Returns 0 if the iterator is positioned over a valid ACE_RB_Tree // node, returns 1 if not. - // DEPRECATED: use the base class done () method instead. + // DEPRECATED: use the base class <done> method instead. }; diff --git a/ace/Reactor.h b/ace/Reactor.h index bbb2fa635f4..ac70c9c01ee 100644 --- a/ace/Reactor.h +++ b/ace/Reactor.h @@ -309,7 +309,7 @@ public: virtual int suspend_handler (ACE_Event_Handler *event_handler); // Suspend <event_handler> temporarily. Use - // <event_handler->get_handle()> to get the handle. + // <ACE_Event_Handler::get_handle> to get the handle. virtual int suspend_handler (ACE_HANDLE handle); // Suspend <handle> temporarily. @@ -321,8 +321,8 @@ public: // Suspend all <handles> temporarily. virtual int resume_handler (ACE_Event_Handler *event_handler); - // Resume <event_handler>. Use <event_handler->get_handle()> to get - // the handle. + // Resume <event_handler>. Use <ACE_Event_Handler::get_handle> to + // get the handle. virtual int resume_handler (ACE_HANDLE handle); // Resume <handle>. diff --git a/ace/Reactor_Impl.h b/ace/Reactor_Impl.h index 7eb92659812..a28eed5641a 100644 --- a/ace/Reactor_Impl.h +++ b/ace/Reactor_Impl.h @@ -261,7 +261,7 @@ public: virtual int suspend_handler (ACE_Event_Handler *event_handler) = 0; // Suspend <event_handler> temporarily. Use - // <event_handler->get_handle()> to get the handle. + // <ACE_Event_Handler::get_handle> to get the handle. virtual int suspend_handler (ACE_HANDLE handle) = 0; // Suspend <handle> temporarily. @@ -273,8 +273,8 @@ public: // Suspend all <handles> temporarily. virtual int resume_handler (ACE_Event_Handler *event_handler) = 0; - // Resume <event_handler>. Use <event_handler->get_handle()> to get - // the handle. + // Resume <event_handler>. Use <ACE_Event_Handler::get_handle> to + // get the handle. virtual int resume_handler (ACE_HANDLE handle) = 0; // Resume <handle>. diff --git a/ace/Registry.h b/ace/Registry.h index 1172290300a..5fa265720cd 100644 --- a/ace/Registry.h +++ b/ace/Registry.h @@ -37,8 +37,8 @@ class ACE_Export ACE_Registry // = DESCRIPTION // The registry interface is inspired by the interface // specified in the CORBA Naming Service Specification. - // The implementation is done through Win32 Reg*() functions. - // Other than providing an OO wrapper for the Win32 Reg*() + // The implementation is done through Win32 <Reg*> functions. + // Other than providing an OO wrapper for the Win32 <Reg*> // functions, ACE_Registry provides an abstraction for iteration // over the elements of the Registry. public: @@ -79,7 +79,7 @@ public: struct ACE_Export Binding { - Binding (); + Binding (void); // Empty (default) constructor Binding (const Name &binding_name, @@ -184,8 +184,7 @@ public: // Constructor: key_ will be set to <key> ~Naming_Context (void); - // Destructor will call this->close() - + // Destructor will call <Naming_Context::close>. // The following interfaces are for objects @@ -306,7 +305,7 @@ public: // Remove naming_context with <name> from <this> context int destroy (void); - // Same as unbind_context() with <this> as naming_context + // Same as <unbind_context> with <this> as naming_context int list (u_long how_many, Binding_List &list, @@ -329,7 +328,7 @@ public: int close (void); // Close the handle of the context - // Note: close() does not call flush() + // Note: <close> does not call <flush> // Accessors @@ -393,7 +392,7 @@ public: friend class Naming_Context; // Friend factory - Binding_Iterator (); + Binding_Iterator (void); // Default constructor int next_one (Binding &binding); @@ -434,7 +433,7 @@ public: Binding_List &list) = 0; // Next <how_many> entries - void reset (); + void reset (void); // Reset state protected: diff --git a/ace/Remote_Tokens.h b/ace/Remote_Tokens.h index 4aa5dab587c..43471a556c7 100644 --- a/ace/Remote_Tokens.h +++ b/ace/Remote_Tokens.h @@ -42,7 +42,7 @@ class ACE_Export ACE_Remote_Token_Proxy : public ACE_Token_Proxy // ACE_Token_Proxy. // // = BUGS - // Distributed sleep_hooks have not been implemented. owner_id () + // Distributed sleep_hooks have not been implemented. <owner_id> // is not implemented. public: ACE_Remote_Token_Proxy (void); @@ -89,14 +89,14 @@ public: // Renew the token by offering to release it if there are any other // waiters, otherwise get the token back immediately. This renew // has the same semantics as ACE_Local_Mutex release. It is - // semantically equivalent to <this->release()> followed by - // <this->acquire()>, but it is faster. options contains the - // timeout value used if renew blocks. As with acquire, the timer - // is maintained at the token server. If there are waiters and - // requeue_position == -1, the caller is queued at the rear of the - // waiter list. Otherwise, requeue_position specifies the number of - // waiters to "let by" before reacquiring the token (effectively, - // the position in the waiter list.) + // semantically equivalent to <release> followed by <acquire>, but + // it is faster. options contains the timeout value used if renew + // blocks. As with acquire, the timer is maintained at the token + // server. If there are waiters and requeue_position == -1, the + // caller is queued at the rear of the waiter list. Otherwise, + // requeue_position specifies the number of waiters to "let by" + // before reacquiring the token (effectively, the position in the + // waiter list.) virtual int release (ACE_Synch_Options &options = ACE_Synch_Options::synch); diff --git a/ace/SPIPE_Connector.h b/ace/SPIPE_Connector.h index 422e272e004..4e5c2d0ff9a 100644 --- a/ace/SPIPE_Connector.h +++ b/ace/SPIPE_Connector.h @@ -53,7 +53,7 @@ public: // the default value of <ACE_Addr::sap_any> then the user is letting // the OS do the binding. If <reuse_addr> == 1 then the // <local_addr> is reused, even if it hasn't been cleanedup yet. - // The <flags> and <perms> arguments are passed down to the open() + // The <flags> and <perms> arguments are passed down to the <open> // method. int connect (ACE_SPIPE_Stream &new_io, @@ -76,7 +76,7 @@ public: // the default value of <ACE_Addr::sap_any> then the user is letting // the OS do the binding. If <reuse_addr> == 1 then the // <local_addr> is reused, even if it hasn't been cleanedup yet. - // The <flags> and <perms> arguments are passed down to the open() + // The <flags> and <perms> arguments are passed down to the <open> // method. int reset_new_handle (ACE_HANDLE handle); diff --git a/ace/SString.h b/ace/SString.h index 63f8a949d3c..f53f904050e 100644 --- a/ace/SString.h +++ b/ace/SString.h @@ -609,7 +609,7 @@ class ACE_Export ACE_Auto_String_Free // // = DESCRIPTION // Keeps a pointer to a string and deallocates it (using - // ACE_OS::free()) on its destructor. + // <ACE_OS::free>) on its destructor. // If you need to delete using "delete[]" the // ACE_Auto_Array_Ptr<char*> is your choice. // The class plays the same role as auto_ptr<> diff --git a/ace/SV_Message_Queue.h b/ace/SV_Message_Queue.h index 807faa7fdf7..6a49abcf4d4 100644 --- a/ace/SV_Message_Queue.h +++ b/ace/SV_Message_Queue.h @@ -84,7 +84,7 @@ public: protected: int internal_id_; - // Returned from the underlying msgget() system call. + // Returned from the underlying <msgget> system call. }; #if !defined (ACE_LACKS_INLINE_FUNCTIONS) diff --git a/ace/SV_Semaphore_Complex.h b/ace/SV_Semaphore_Complex.h index 4f904e56468..a72c96d33bf 100644 --- a/ace/SV_Semaphore_Complex.h +++ b/ace/SV_Semaphore_Complex.h @@ -41,15 +41,15 @@ class ACE_Export ACE_SV_Semaphore_Complex : private ACE_SV_Semaphore_Simple // initialized to a large number, decremented on every create // or open and incremented on every close. This way we can use // the "adjust" feature provided by System V so that any - // process that exit's without calling close() is accounted + // process that exit's without calling <close> is accounted // for. It doesn't help us if the last process does this (as we // have no way of getting control to remove the // ACE_SV_Semaphore) but it will work if any process other than // the last does an exit (intentional or unintentional). // // The second member, [1], of the ACE_SV_Semaphore is used as a - // lock variable to avoid any race conditions in the create() - // and close() functions. + // lock variable to avoid any race conditions in the <create> + // and <close> functions. // // The members beyond [1] are actual ACE_SV_Semaphore values in // the array of SV_Semaphores (which may be sized by the user diff --git a/ace/SV_Semaphore_Simple.h b/ace/SV_Semaphore_Simple.h index 41ee8fe7e1f..ab7db7ef87a 100644 --- a/ace/SV_Semaphore_Simple.h +++ b/ace/SV_Semaphore_Simple.h @@ -74,7 +74,7 @@ public: // call is intended to be called from a server, for example, when it // is being shut down, as we do an IPC_RMID on the ACE_SV_Semaphore, // regardless of whether other processes may be using it or not. - // Most other processes should use close() below. + // Most other processes should use <close> below. // = Semaphore acquire and release methods. int acquire (u_short n = 0, int flags = 0) const; diff --git a/ace/Sched_Params.h b/ace/Sched_Params.h index 6817fd677d7..24ade4a5773 100644 --- a/ace/Sched_Params.h +++ b/ace/Sched_Params.h @@ -32,44 +32,45 @@ class ACE_Export ACE_Sched_Params // Container for scheduling-related parameters. // // = DESCRIPTION - // ACE_Sched_Params are passed via - // ACE_OS::sched_params () to the OS to specify scheduling - // parameters. These parameters include scheduling policy, - // such as FIFO, round-robin, or an implementation-defined - // "OTHER" (to which many systems default); priority; and - // a time-slice quantum for round-robin scheduling. - // A "scope" parameter specifies whether the ACE_Sched_Params + // ACE_Sched_Params are passed via <ACE_OS::sched_params> to the + // OS to specify scheduling parameters. These parameters include + // scheduling policy, such as FIFO (ACE_SCHED_FIFO), round-robin + // (ACE_SCHED_RR), or an implementation-defined "OTHER" + // (ACE_SCHED_OTHER), to which many systems default; priority; + // and a time-slice quantum for round-robin scheduling. A + // "scope" parameter specifies whether the ACE_Sched_Params // applies to the current process, current lightweight process // (LWP) (on Solaris), or current thread. Please see the "NOTE" - // below about not all combinations of parameters being legal - // on a particular platform. + // below about not all combinations of parameters being legal on + // a particular platform. // // For the case of thread priorities, it is intended that - // ACE_OS::sched_params () usually be called from main () before - // any threads have been spawned. - // If spawned threads inherit their parent's priority (I think - // that's the default behavior for all of our platforms), then - // this sets the default base priority. Individual thread priorities - // can be adjusted as usual using ACE_OS::thr_prio () or via the - // ACE_Thread interface. See the parameter descriptions in the - // private: section below. + // <ACE_OS::sched_params> usually be called from <main> before + // any threads have been spawned. If spawned threads inherit + // their parent's priority (I think that's the default behavior + // for all of our platforms), then this sets the default base + // priority. Individual thread priorities can be adjusted as + // usual using <ACE_OS::thr_prio> or via the ACE_Thread + // interface. See the parameter descriptions in the private: + // section below. // - // NOTE: this class does not do any checking of parameters. - // It is just a container class. If it is constructed with values + // NOTE: this class does not do any checking of parameters. It + // is just a container class. If it is constructed with values // that are not supported on a platform, the call to - // ACE_OS::sched_params () will fail by returning -1 with EINVAL - // (available through ACE_OS::last_error ()). + // <ACE_OS::sched_params> will fail by returning -1 with EINVAL + // (available through <ACE_OS::last_error>). - // NOTE: Solaris 2.5.x threads in the RT class must set the + // NOTE: Solaris 2.5.x threads in the RT class must set the // priority of their LWP. The only way to do that through ACE is - // for the RT thread itself to call ACE_OS::thr_setprio () with + // for the RT thread itself to call <ACE_OS::thr_setprio> with // it's own priority. - // OS Scheduling parameters are complicated and often confusing. Many - // thanks to Thilo Kielmann <kielmann@informatik.uni-siegen.de> for his - // careful review of this class design, thoughtful comments, and - // assistance with implementation, especially for PTHREADS platforms. - // Please send any comments or corrections to the ACE developers. + // OS Scheduling parameters are complicated and often confusing. + // Many thanks to Thilo Kielmann + // <kielmann@informatik.uni-siegen.de> for his careful review of + // this class design, thoughtful comments, and assistance with + // implementation, especially for PTHREADS platforms. Please + // send any comments or corrections to the ACE developers. public: typedef int Policy; diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index e5065b865c6..8f8fd2c4070 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -502,7 +502,8 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, if (disable_notify_pipe == 0) { - this->select_reactor_ = ACE_dynamic_cast (ACE_Select_Reactor_Impl *, r); + this->select_reactor_ = + ACE_dynamic_cast (ACE_Select_Reactor_Impl *, r); if (select_reactor_ == 0) { diff --git a/ace/Select_Reactor_Base.h b/ace/Select_Reactor_Base.h index 12fd7a80518..01789b46df7 100644 --- a/ace/Select_Reactor_Base.h +++ b/ace/Select_Reactor_Base.h @@ -86,7 +86,7 @@ class ACE_Export ACE_Select_Reactor_Notify : public ACE_Reactor_Notify // = DESCRIPTION // This implementation is necessary for cases where the // <ACE_Select_Reactor> is run in a multi-threaded program. In - // this case, we need to be able to unblock select() or poll() + // this case, we need to be able to unblock <select> or <poll> // when updates occur other than in the main // <ACE_Select_Reactor> thread. To do this, we signal an // auto-reset event the <ACE_Select_Reactor> is listening on. @@ -112,7 +112,7 @@ public: ACE_Time_Value * = 0); // Called by a thread when it wants to unblock the // <ACE_Select_Reactor>. This wakeups the <ACE_Select_Reactor> if - // currently blocked in select()/poll(). Pass over both the + // currently blocked in <select>/<poll>. Pass over both the // <Event_Handler> *and* the <mask> to allow the caller to dictate // which <Event_Handler> method the <ACE_Select_Reactor> will // invoke. The <ACE_Time_Value> indicates how long to blocking @@ -321,7 +321,7 @@ public: // Default size of the Select_Reactor's handle table. }; - ACE_Select_Reactor_Impl (); + ACE_Select_Reactor_Impl (void); friend class ACE_Select_Reactor_Notify; friend class ACE_Select_Reactor_Handler_Repository; @@ -341,14 +341,14 @@ protected: // Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s. ACE_Select_Reactor_Handle_Set wait_set_; - // Tracks handles that are waited for by select(). + // Tracks handles that are waited for by <select>. ACE_Select_Reactor_Handle_Set suspend_set_; // Tracks handles that are currently suspended. ACE_Select_Reactor_Handle_Set ready_set_; // Track HANDLES we are interested in for various events that must - // be dispatched *without* going through select(). + // be dispatched *without* going through <select>. ACE_Timer_Queue *timer_queue_; // Defined as a pointer to allow overriding by derived classes... @@ -378,7 +378,7 @@ protected: int requeue_position_; // Position that the main ACE_Select_Reactor thread is requeued in - // the list of waiters during a notify() callback. If this value == + // the list of waiters during a <notify> callback. If this value == // -1 we are requeued at the end of the list. Else if it's 0 then // we are requeued at the front of the list. Else if it's > 1 then // that indicates the number of waiters to skip over. diff --git a/ace/Select_Reactor_T.h b/ace/Select_Reactor_T.h index e4ee05b97ea..cf92a670f88 100644 --- a/ace/Select_Reactor_T.h +++ b/ace/Select_Reactor_T.h @@ -209,15 +209,16 @@ public: virtual int register_handler (ACE_Event_Handler *eh, ACE_Reactor_Mask mask); // Register a <eh> with a particular <mask>. Note that the - // <Select_Reactor> will call eh->get_handle() to extract the - // underlying I/O handle. + // <Select_Reactor> will call <ACE_Event_Handler::get_handle> to + // extract the underlying I/O handle. virtual int register_handler (ACE_HANDLE handle, ACE_Event_Handler *eh, ACE_Reactor_Mask mask); // Register a <eh> with a particular <mask>. Note that since the // <handle> is given the Select_Reactor will *not* call - // eh->get_handle() to extract the underlying I/O handle. + // <ACE_Event_Handler::get_handle> to extract the underlying I/O + // handle. #if defined (ACE_WIN32) @@ -265,7 +266,8 @@ public: // Removes the <mask> binding of <eh> from the Select_Reactor. If // there are no more bindings for this <eh> then it is removed from // the Select_Reactor. Note that the Select_Reactor will call - // eh->get_handle() to extract the underlying I/O handle. + // <ACE_Event_Handler::get_handle> to extract the underlying I/O + // handle. virtual int remove_handler (ACE_HANDLE handle, ACE_Reactor_Mask); @@ -388,7 +390,7 @@ public: ACE_Time_Value * = 0); // Called by a thread when it wants to unblock the Select_Reactor. // This wakeups the <ACE_Select_Reactor> if currently blocked in - // select()/poll(). Pass over both the <Event_Handler> *and* the + // <select>/<poll>. Pass over both the <Event_Handler> *and* the // <mask> to allow the caller to dictate which <Event_Handler> // method the <Select_Reactor> will invoke. The <ACE_Time_Value> // indicates how long to blocking trying to notify the @@ -414,11 +416,11 @@ public: virtual void requeue_position (int); // Set position that the main ACE_Select_Reactor thread is requeued in the - // list of waiters during a notify() callback. + // list of waiters during a <notify> callback. virtual int requeue_position (void); // Get position that the main ACE_Select_Reactor thread is requeued in the - // list of waiters during a notify() callback. + // list of waiters during a <notify> callback. // = Low-level wait_set mask manipulation methods. virtual int mask_ops (ACE_Event_Handler *eh, diff --git a/ace/Service_Config.h b/ace/Service_Config.h index de6e960da81..3042310dd8a 100644 --- a/ace/Service_Config.h +++ b/ace/Service_Config.h @@ -185,26 +185,26 @@ public: // Run the event loop until the <ACE_Reactor::handle_events> method // returns -1 or the <end_reactor_event_loop> method is invoked. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Reactor::run_event_loop() instead. + // Use <ACE_Reactor::run_event_loop> instead. static int run_reactor_event_loop (ACE_Time_Value &tv); // Run the event loop until the <ACE_Reactor::handle_events> method // returns -1, the <end_reactor_event_loop> method is invoked, or the // <ACE_Time_Value> expires. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Reactor::run_event_loop() instead. + // <Use ACE_Reactor::run_event_loop> instead. static int end_reactor_event_loop (void); // Instruct the <ACE_Service_Config> to terminate its event loop and // notifies the <ACE_Reactor::instance> so that it can wake up // and close down gracefully. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Reactor::end_event_loop() instead. + // Use <ACE_Reactor::end_event_loop> instead. static int reactor_event_loop_done (void); // Report if the Reactor's event loop is finished. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Reactor::event_loop_done() instead. + // Use <ACE_Reactor::event_loop_done> instead. static int reconfig_occurred (void); // True if reconfiguration occurred. @@ -228,46 +228,46 @@ public: static ACE_Reactor *reactor (void); // Get pointer to a process-wide <ACE_Reactor>. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Reactor::instance() instead. + // Use <ACE_Reactor::instance> instead. static ACE_Reactor *reactor (ACE_Reactor *); // Set pointer to a process-wide <ACE_Reactor> and return existing // pointer. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Reactor::instance() instead. + // Use <ACE_Reactor::instance> instead. static ACE_Service_Repository *svc_rep (void); // Get pointer to a process-wide <ACE_Service_Repository>. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Service_Repository::instance() instead. + // Use <ACE_Service_Repository::instance> instead. static ACE_Service_Repository *svc_rep (ACE_Service_Repository *); // Set pointer to a process-wide <ACE_Service_Repository> and return // existing pointer. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Service_Repository::instance() instead. + // Use <ACE_Service_Repository::instance> instead. static ACE_Thread_Manager *thr_mgr (void); // Get pointer to a process-wide <ACE_Thread_Manager>. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Thread_Manager::instance() instead. + // Use <ACE_Thread_Manager::instance> instead. static ACE_Thread_Manager *thr_mgr (ACE_Thread_Manager *); // Set pointer to a process-wide <ACE_Thread_Manager> and return // existing pointer. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Thread_Manager::instance() instead. + // Use <ACE_Thread_Manager::instance> instead. static ACE_Allocator *alloc (void); // Get pointer to a default <ACE_Allocator>. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Allocator::instance() instead. + // Use <ACE_Allocator::instance> instead. static ACE_Allocator *alloc (ACE_Allocator *); // Set pointer to a process-wide <ACE_Allocator> and return existing // pointer. // DO NOT USE THIS METHOD. It may be unsupported in future releases. - // Use ACE_Allocator::instance() instead. + // Use <ACE_Allocator::instance> instead. // = Utility methods. static int initialize (const ACE_Service_Type *, @@ -285,11 +285,11 @@ public: static int suspend (const ASYS_TCHAR svc_name[]); // Suspend <svc_name>. Note that this will not unlink the service - // from the daemon if it was dynamically linked, it will mark it - // as being suspended in the Service Repository and call the - // suspend() member function on the appropriate ACE_Service_Object. - // A service can be resumed later on by calling the RESUME() - // member function... + // from the daemon if it was dynamically linked, it will mark it as + // being suspended in the Service Repository and call the <suspend> + // member function on the appropriate <ACE_Service_Object>. A + // service can be resumed later on by calling the <RESUME> member + // function... static int remove (const ASYS_TCHAR svc_name[]); // Totally remove <svc_name> from the daemon by removing it diff --git a/ace/Service_Object.h b/ace/Service_Object.h index e6e9817345b..4a54586ec68 100644 --- a/ace/Service_Object.h +++ b/ace/Service_Object.h @@ -96,7 +96,7 @@ public: void active (int); void fini (void); - // Calls fini() on <type_> + // Calls <fini> on <type_> int fini_called (void) const; // Check if the service has been fini'ed. @@ -127,7 +127,7 @@ private: // 1 if svc is currently active, otherwise 0. int fini_already_called_; - // 1 if fini() on <type_> has already been called, otherwise 0. + // 1 if <fini> on <type_> has already been called, otherwise 0. }; class ACE_Export ACE_Service_Object_Ptr diff --git a/ace/Signal.h b/ace/Signal.h index d9901345263..bc2c83c240c 100644 --- a/ace/Signal.h +++ b/ace/Signal.h @@ -247,7 +247,7 @@ public: static void dispatch (int, siginfo_t *, ucontext_t *); // Callback routine registered with sigaction(2) that dispatches the - // handle_signal() method of the appropriate pre-registered + // <handle_signal> method of the appropriate pre-registered // ACE_Event_Handler. void dump (void) const; @@ -362,7 +362,7 @@ public: static void dispatch (int signum, siginfo_t *, ucontext_t *); // Callback routine registered with sigaction(2) that dispatches the - // handle_signal() method of all the pre-registered + // <handle_signal> method of all the pre-registered // ACE_Event_Handlers for <signum> void dump (void) const; diff --git a/ace/Singleton.h b/ace/Singleton.h index 9bef9acf126..0d3d6d65f74 100644 --- a/ace/Singleton.h +++ b/ace/Singleton.h @@ -116,7 +116,7 @@ class ACE_Unmanaged_Singleton : public ACE_Singleton <TYPE, ACE_LOCK> // destroys the instance. Unlike with <ACE_Singleton>, the // application is responsible for explicitly destroying the // instance after it is no longer needed (if it wants to avoid - // memory leaks, at least). The close () static member function + // memory leaks, at least). The <close> static member function // must be used to explicitly destroy the Singleton. // public: @@ -202,7 +202,7 @@ class ACE_Unmanaged_TSS_Singleton : public ACE_TSS_Singleton <TYPE, ACE_LOCK> // <ACE_Singleton>, the application is responsible for // explicitly destroying the instance after it is no longer // needed (if it wants to avoid memory leaks, at least). The - // close () static member function must be used to explicitly + // <close> static member function must be used to explicitly // destroy the Singleton. // public: diff --git a/ace/Stats.h b/ace/Stats.h index 83feaea3939..5b1f568441e 100644 --- a/ace/Stats.h +++ b/ace/Stats.h @@ -146,7 +146,7 @@ public: // scale factor, it successively tries to reduce it. Returns -1 if // there is overflow even with a 0 scale factor. - void reset (); + void reset (void); // Initialize internal state. static void quotient (const ACE_UINT64 dividend, diff --git a/ace/Strategies.h b/ace/Strategies.h index 1574557cf37..29ad3d01c2e 100644 --- a/ace/Strategies.h +++ b/ace/Strategies.h @@ -64,7 +64,7 @@ class ACE_Export ACE_Reactor_Notification_Strategy : public ACE_Notification_Str // // = DESCRIPTION // Integrates the ACE_Message_Queue notification into the - // ACE_Reactor::notify() method. + // <ACE_Reactor::notify> method. public: ACE_Reactor_Notification_Strategy (ACE_Reactor *reactor, ACE_Event_Handler *eh, diff --git a/ace/Strategies_T.cpp b/ace/Strategies_T.cpp index 9185bf10b2d..6c446c2c7db 100644 --- a/ace/Strategies_T.cpp +++ b/ace/Strategies_T.cpp @@ -28,10 +28,24 @@ ACE_Singleton_Strategy<SVC_HANDLER>::open (SVC_HANDLER *sh, { ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::open"); - if (this->svc_handler_ != 0) + if (this->delete_svc_handler_ + && this->svc_handler_ != 0) delete this->svc_handler_; - this->svc_handler_ = sh; + // If <sh> is NULL then create a new <SVC_HANDLER>. + if (sh == 0) + { + ACE_NEW_RETURN (this->svc_handler_, + SVC_HANDLER, + -1); + this->delete_svc_handler_ = 1; + } + else + { + this->svc_handler_ = sh; + this->delete_svc_handler_ = 0; + } + return 0; } @@ -218,20 +232,22 @@ ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handler { ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler"); // Call up to our parent to do the SVC_HANDLER initialization. - if (this->inherited::activate_svc_handler (svc_handler, arg) == -1) + if (this->inherited::activate_svc_handler (svc_handler, + arg) == -1) return -1; else // Turn the <svc_handler> into an active object (if it isn't // already one as a result of the first activation...) - return svc_handler->activate (this->thr_flags_, this->n_threads_); + return svc_handler->activate (this->thr_flags_, + this->n_threads_); } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy -(const ACE_PEER_ACCEPTOR_ADDR &local_addr, - int restart, - ACE_Reactor *reactor) - : reactor_ (reactor) + (const ACE_PEER_ACCEPTOR_ADDR &local_addr, + int restart, + ACE_Reactor *reactor) + : reactor_ (reactor) { ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy"); @@ -395,7 +411,9 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::ACE_Cache ACE_NEW (this->reverse_lock_, REVERSE_MUTEX (*this->lock_)); - if (this->open (cre_s, con_s, rec_s) == -1) + if (this->open (cre_s, + con_s, + rec_s) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Cached_Connect_Strategy::ACE_Cached_Connect_Strategy"))); diff --git a/ace/Strategies_T.h b/ace/Strategies_T.h index ab700219755..1c1d0a33711 100644 --- a/ace/Strategies_T.h +++ b/ace/Strategies_T.h @@ -129,6 +129,9 @@ public: protected: SVC_HANDLER *svc_handler_; // Pointer to the Singleton svc_handler. + + int delete_svc_handler_; + // Keep track of whether we need to delete the <SVC_HANDLER>. }; template <class SVC_HANDLER> @@ -196,7 +199,7 @@ class ACE_Concurrency_Strategy // // = DESCRIPTION // Default behavior is to activate the SVC_HANDLER by calling - // its open() method (which allows the SVC_HANDLER to define its + // its <open> method (which allows the SVC_HANDLER to define its // own concurrency strategy). However, subclasses can override // this default strategy to do more sophisticated concurrency // activations (such as creating the SVC_HANDLER as an active @@ -210,7 +213,7 @@ public: void *arg = 0); // Activate the <svc_handler> with an appropriate concurrency // strategy. The default behavior of this method is to activate the - // SVC_HANDLER by calling its open() method (which allows the + // SVC_HANDLER by calling its <open> method (which allows the // SVC_HANDLER to define its own concurrency strategy). virtual ~ACE_Concurrency_Strategy (void); @@ -316,7 +319,7 @@ public: void *arg = 0); // Activate the <svc_handler> with an appropriate concurrency // strategy. This method activates the SVC_HANDLER by first calling - // its open() method and then calling its activate() method to turn + // its <open> method and then calling its <activate> method to turn // it into an active object. void dump (void) const; @@ -332,7 +335,7 @@ protected: // Thread manager for this class (must be provided). long thr_flags_; - // Flags to pass into the SVC_HANDLER::activate() method. + // Flags to pass into the <SVC_HANDLER::activate> method. size_t n_threads_; // Number of threads to spawn. @@ -375,7 +378,7 @@ public: void *arg = 0); // Activate the <svc_handler> with an appropriate concurrency // strategy. This method activates the SVC_HANDLER by first forking - // and then calling the open() method of the SVC_HANDLER in the + // and then calling the <open> method of the SVC_HANDLER in the // child. void dump (void) const; diff --git a/ace/Strategies_T.i b/ace/Strategies_T.i index 80932a5ea73..096a1e046c4 100644 --- a/ace/Strategies_T.i +++ b/ace/Strategies_T.i @@ -24,17 +24,22 @@ ACE_Recycling_Strategy<SVC_HANDLER>::prepare_for_recycling (SVC_HANDLER *svc_han template <class SVC_HANDLER> ASYS_INLINE ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy (SVC_HANDLER *sh, ACE_Thread_Manager *tm) - : svc_handler_ (0) + : svc_handler_ (0), + delete_svc_handler_ (1) { ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy"); - this->open (sh, tm); + if (this->open (sh, tm) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Singleton_Strategy"))); } template <class SVC_HANDLER> ASYS_INLINE ACE_Singleton_Strategy<SVC_HANDLER>::~ACE_Singleton_Strategy (void) { ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::~ACE_Singleton_Strategy"); - delete this->svc_handler_; + if (this->delete_svc_handler_ != 0) + delete this->svc_handler_; } // Create a Singleton SVC_HANDLER by always returning the same @@ -61,7 +66,10 @@ template <class SVC_HANDLER> ASYS_INLINE ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy (ACE_Thread_Manager *thr_mgr) { ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy"); - this->open (thr_mgr); + if (this->open (thr_mgr) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Creation_Strategy"))); } // Default behavior is to make a new SVC_HANDLER, passing in the @@ -94,8 +102,11 @@ ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy (const char dll_name[], if (this->open (dll_name, factory_function, svc_name, - svc_rep, thr_mgr) == -1) - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("open"))); + svc_rep, + thr_mgr) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("open"))); } template <class SVC_HANDLER> ASYS_INLINE @@ -124,8 +135,11 @@ ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy (ACE_Reactor *reactor, { ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy"); - if (this->open (reactor, mask, flags) == -1) - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + if (this->open (reactor, + mask, + flags) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy"))); } @@ -152,7 +166,10 @@ ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy (ACE_Thread_Manager *thr_m { ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy"); - if (this->open (thr_mgr, thr_flags, n_threads, flags) == -1) + if (this->open (thr_mgr, + thr_flags, + n_threads, + flags) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy"))); @@ -237,10 +254,13 @@ ACE_Process_Strategy<SVC_HANDLER>::ACE_Process_Strategy (size_t n_processes, int avoid_zombies) { ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::ACE_Process_Strategy"); - this->open (n_processes, - acceptor, - reactor, - avoid_zombies); + if (this->open (n_processes, + acceptor, + reactor, + avoid_zombies) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Process_Strategy"))); } template <class SVC_HANDLER> ASYS_INLINE diff --git a/ace/Stream.h b/ace/Stream.h index 58fd26c2b61..a7c2df28139 100644 --- a/ace/Stream.h +++ b/ace/Stream.h @@ -63,7 +63,7 @@ public: // Create a Stream consisting of <head> and <tail> as the Stream // head and Stream tail, respectively. If these are 0 then the // <ACE_Stream_Head> and <ACE_Stream_Tail> are used, respectively. - // <arg> is the value past in to the open() methods of the tasks. + // <arg> is the value past in to the <open> methods of the tasks. virtual int open (void *arg, ACE_Module<ACE_SYNCH_USE> *head = 0, @@ -71,7 +71,7 @@ public: // Create a Stream consisting of <head> and <tail> as the Stream // head and Stream tail, respectively. If these are 0 then the // <ACE_Stream_Head> and <ACE_Stream_Tail> are used, respectively. - // <arg> is the value past in to the open() methods of the tasks. + // <arg> is the value past in to the <open> methods of the tasks. virtual int close (int flags = M_DELETE); // Close down the stream and release all the resources. @@ -94,7 +94,7 @@ public: virtual int remove (const ASYS_TCHAR *mod, int flags = M_DELETE); // Remove the named module <mod> from the stream. This bypasses the - // strict LIFO ordering of push() and pop(). + // strict LIFO ordering of <push> and <pop>. virtual ACE_Module<ACE_SYNCH_USE> *head (void); // Return current stream head. diff --git a/ace/Synch_T.h b/ace/Synch_T.h index fecba0de29d..354585f8602 100644 --- a/ace/Synch_T.h +++ b/ace/Synch_T.h @@ -104,15 +104,15 @@ class ACE_Reverse_Lock : public ACE_Lock // // = DESCRIPTION // This is an interesting adapter class that changes a lock into - // a reverse lock, i.e., acquire() on this class calls release() - // on the lock, and release() on this class calls acquire() on + // a reverse lock, i.e., <acquire> on this class calls <release> + // on the lock, and <release> on this class calls <acquire> on // the lock. // // One motivation for this class is when we temporarily want to // release a lock (which we have already acquired) but then // reaquire it soon after. An alternative design would be to - // add a Anti_Guard or Reverse_Guard class which would release() - // on construction and acquire() destruction. However, there + // add a Anti_Guard or Reverse_Guard class which would <release> + // on construction and <acquire> destruction. However, there // are *many* varieties of the Guard class and this design // choice would lead to at least 6 new classes. One new // ACE_Reverse_Lock class seemed more reasonable. @@ -302,14 +302,14 @@ class ACE_TSS // // = DESCRIPTION // This class is a wrapper around the OS thread library - // thread-specific functions. It uses the C++ operator->() to + // thread-specific functions. It uses the <C++ operator->> to // shield applications from the details of accessing // thread-specific storage. // // NOTE: TYPE cannot be a built-in type, but instead must be a // user-defined class. (Some compilers will allow a built-in // type, but shouldn't. Sun C++ won't, properly detecting the - // improper return type from operator-> ().) See template class + // improper return type from <operator->>.) See template class // ACE_TSS_Type_Adapter, below, for adapting built-in types to // work with ACE_TSS. public: @@ -318,7 +318,7 @@ public: ACE_TSS (TYPE *ts_obj = 0); // If caller has passed us a non-NULL ts_obj *, then we'll just use // this to initialize the thread-specific value (but only for the - // calling thread). Thus, subsequent calls to operator->() in this + // calling thread). Thus, subsequent calls to <operator->> in this // thread will return this value. This is useful since it enables // us to assign objects to thread-specific data that have // arbitrarily complex constructors. @@ -497,37 +497,28 @@ class ACE_Write_Guard : public ACE_Guard<ACE_LOCK> public: // = Initialization method. - ACE_Write_Guard (ACE_LOCK &m): ACE_Guard<ACE_LOCK> (&m) - { - this->acquire_write (); - } + ACE_Write_Guard (ACE_LOCK &m); // Implicitly and automatically acquire a write lock. - ACE_Write_Guard (ACE_LOCK &m, int block): ACE_Guard<ACE_LOCK> (&m) - { - if (block) - this->acquire_write (); - else - this->tryacquire_write (); - } + ACE_Write_Guard (ACE_LOCK &m, int block); // Implicitly and automatically acquire (or try to acquire) a write // lock. // = Lock accessors. - int acquire_write (void) { return this->owner_ = this->lock_->acquire_write (); } + int acquire_write (void); // Explicitly acquire the write lock. - int acquire (void) { return this->owner_ = this->lock_->acquire_write (); } + int acquire (void); // Explicitly acquire the write lock. - int tryacquire_write (void) { return this->owner_ = this->lock_->tryacquire_write (); } + int tryacquire_write (void); // Conditionally acquire the write lock (i.e., won't block). - int tryacquire (void) { return this->owner_ = this->lock_->tryacquire_write (); } + int tryacquire (void); // Conditionally acquire the write lock (i.e., won't block). - // Utility methods. + // = Utility methods. void dump (void) const; // Dump the state of an object. @@ -547,33 +538,25 @@ class ACE_Read_Guard : public ACE_Guard<ACE_LOCK> public: // = Initialization methods. - ACE_Read_Guard (ACE_LOCK& m): ACE_Guard<ACE_LOCK> (&m) - { - this->acquire_read (); - } - - ACE_Read_Guard (ACE_LOCK &m, int block): ACE_Guard<ACE_LOCK> (&m) - { - if (block) - this->acquire_read (); - else - this->tryacquire_read (); - } + ACE_Read_Guard (ACE_LOCK& m); + // Implicitly and automatically acquire a read lock. + + ACE_Read_Guard (ACE_LOCK &m, int block); // Implicitly and automatically acquire (or try to acquire) a read // lock. // = Lock accessors. - int acquire_read (void) { return this->owner_ = this->lock_->acquire_read (); } + int acquire_read (void); // Explicitly acquire the read lock. - int acquire (void) { return this->owner_ = this->lock_->acquire_read (); } + int acquire (void); // Explicitly acquire the read lock. - int tryacquire_read (void) { return this->owner_ = this->lock_->tryacquire_read (); } + int tryacquire_read (void); // Conditionally acquire the read lock (i.e., won't block). - int tryacquire (void) { return this->owner_ = this->lock_->tryacquire_read (); } + int tryacquire (void); // Conditionally acquire the read lock (i.e., won't block). // = Utility methods. @@ -602,7 +585,7 @@ class ACE_TSS_Guard // This data structure is meant to be used within a method or // function... It performs automatic aquisition and release of // a synchronization object. Moreover, it ensures that the lock - // is released even if a thread exits via "thr_exit()"! + // is released even if a thread exits via <thr_exit>! public: // = Initialization and termination methods. diff --git a/ace/Synch_T.i b/ace/Synch_T.i index cb190580243..2a14fd7a399 100644 --- a/ace/Synch_T.i +++ b/ace/Synch_T.i @@ -7,14 +7,16 @@ template <class ACE_LOCK> ACE_INLINE ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l) - : lock_ (&l), owner_ (0) + : lock_ (&l), + owner_ (0) { this->acquire (); } template <class ACE_LOCK> ACE_INLINE ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l, int block) - : lock_ (&l), owner_ (0) + : lock_ (&l), + owner_ (0) { if (block) this->acquire (); @@ -31,24 +33,18 @@ ACE_Guard<ACE_LOCK>::~ACE_Guard (void) this->release (); } -// Implicitly release the lock. - template <class ACE_LOCK> ACE_INLINE int ACE_Guard<ACE_LOCK>::acquire (void) { return this->owner_ = this->lock_->acquire (); } -// Explicitly acquire the lock. - template <class ACE_LOCK> ACE_INLINE int ACE_Guard<ACE_LOCK>::tryacquire (void) { return this->owner_ = this->lock_->tryacquire (); } -// Conditionally acquire the lock (i.e., won't block). - template <class ACE_LOCK> ACE_INLINE int ACE_Guard<ACE_LOCK>::release (void) { @@ -61,23 +57,101 @@ ACE_Guard<ACE_LOCK>::release (void) return 0; } -// Explicitly release the lock, but only if it is held! - template <class ACE_LOCK> ACE_INLINE int ACE_Guard<ACE_LOCK>::locked (void) { return this->owner_ != -1; } -// 1 if locked, 0 if couldn't acquire the lock -// (errno will contain the reason for this). - template <class ACE_LOCK> ACE_INLINE int ACE_Guard<ACE_LOCK>::remove (void) { return this->lock_->remove (); } -// Explicitly remove the lock. + +template <class ACE_LOCK> ACE_INLINE +ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m) + : ACE_Guard<ACE_LOCK> (&m) +{ + this->acquire_write (); +} + +template <class ACE_LOCK> ACE_INLINE +ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m, + int block) + : ACE_Guard<ACE_LOCK> (&m) +{ + if (block) + this->acquire_write (); + else + this->tryacquire_write (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Write_Guard<ACE_LOCK>::acquire_write (void) +{ + return this->owner_ = this->lock_->acquire_write (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Write_Guard<ACE_LOCK>::acquire (void) +{ + return this->owner_ = this->lock_->acquire_write (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Write_Guard<ACE_LOCK>::tryacquire_write (void) +{ + return this->owner_ = this->lock_->tryacquire_write (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Write_Guard<ACE_LOCK>::tryacquire (void) +{ + return this->owner_ = this->lock_->tryacquire_write (); +} + +template <class ACE_LOCK> ACE_INLINE +ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m) + : ACE_Guard<ACE_LOCK> (&m) +{ + this->acquire_read (); +} + +template <class ACE_LOCK> ACE_INLINE +ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m, + int block) + : ACE_Guard<ACE_LOCK> (&m) +{ + if (block) + this->acquire_read (); + else + this->tryacquire_read (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Read_Guard<ACE_LOCK>::acquire_read (void) +{ + return this->owner_ = this->lock_->acquire_read (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Read_Guard<ACE_LOCK>::acquire (void) +{ + return this->owner_ = this->lock_->acquire_read (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Read_Guard<ACE_LOCK>::tryacquire_read (void) +{ + return this->owner_ = this->lock_->tryacquire_read (); +} + +template <class ACE_LOCK> ACE_INLINE int +ACE_Read_Guard<ACE_LOCK>::tryacquire (void) +{ + return this->owner_ = this->lock_->tryacquire_read (); +} template <class ACE_LOCKING_MECHANISM> ACE_INLINE ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_Lock_Adapter (ACE_LOCKING_MECHANISM &lock) diff --git a/ace/TP_Reactor.h b/ace/TP_Reactor.h index 6f5bd35886f..dfa7061980a 100644 --- a/ace/TP_Reactor.h +++ b/ace/TP_Reactor.h @@ -13,7 +13,7 @@ // TP_Reactor (ala, Thread Pool Reactor) uses the leader-follower // model to demultiplex requests among a bunch of threads. // Basically, when using thread pool reactor, one will pre-spawn a -// _fixed_ number of threads. When you issue the run_event_loop () +// _fixed_ number of threads. When you issue the <run_event_loop> // method, one of the thread will become the leader thread and wait // for an event. The other threads (followers) will be lined up // and waiting for their turns to become the leader. When an event @@ -78,14 +78,14 @@ class ACE_Export ACE_TP_Reactor : public ACE_Select_Reactor // One of the short comings of the Select_Reactor in ACE is that // it did not support a thread pool based event dispatching // model, similar to the one in WFMO_Reactor. In - // Select_Reactor, only thread can be blocked in handle_events() + // Select_Reactor, only thread can be blocked in <handle_events> // at any given time. // // A new Reactor has been added to ACE that removes this // short-coming. TP_Reactor is a specialization of Select // Reactor to support thread-pool based event dispatching. This // Reactor takes advantage of the fact that events reported by - // select() are persistent if not acted upon immediately. It + // <select> are persistent if not acted upon immediately. It // works by remembering the event handler that just got // activated, releasing the internal lock (so that some other // thread can start waiting in the event loop) and then @@ -161,7 +161,7 @@ protected: ACE_Handle_Set& dispatch_mask, ACE_Handle_Set& ready_mask, ACE_EH_PTMF callback); - // Overwrites ACE_Select_Reactor::dispatch_io_set() to *not* + // Overwrites <ACE_Select_Reactor::dispatch_io_set> to *not* // dispatch any event handlers. The information of one activated // event handler is stored away, so that the event handler can be // dispatch later. diff --git a/ace/Task.h b/ace/Task.h index f0433ed308e..bc196ba7446 100644 --- a/ace/Task.h +++ b/ace/Task.h @@ -83,9 +83,9 @@ public: // interpret this as a flag to shut down the <Task>. virtual int module_closed (void); - // Hook called during ACE_Module::close(). The default + // Hook called during <ACE_Module::close>. The default // implementation calls forwards the call to close(1). Please - // notice the changed value of the default argument of close(). + // notice the changed value of the default argument of <close>. // This allows tasks to differ between the call has been originated // from <ACE_Thread_Exit> or from <module_closed>. Be aware that // close(0) will be also called when a thread associated with the diff --git a/ace/Task_T.h b/ace/Task_T.h index 60b4ef5c5dc..0fb31c4aa78 100644 --- a/ace/Task_T.h +++ b/ace/Task_T.h @@ -117,8 +117,8 @@ public: // Should be protected: int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); // Flush the queue. Note that if this conflicts with the C++ - // iostream flush() function, just rewrite the iostream function as - // ::flush(). + // iostream <flush> function, just rewrite the iostream function as + // ::<flush>. // = Special routines corresponding to certain message types. diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h index cfe72b4122d..c3aa1565ae3 100644 --- a/ace/Thread_Manager.h +++ b/ace/Thread_Manager.h @@ -84,31 +84,31 @@ class ACE_Export ACE_At_Thread_Exit friend class ACE_Thread_Manager; public: // Default constructor - ACE_At_Thread_Exit(void); + ACE_At_Thread_Exit (void); // The destructor - virtual ~ACE_At_Thread_Exit(void); + virtual ~ACE_At_Thread_Exit (void); - // At_Thread_Exit has the ownership? - int is_owner() const; + // <At_Thread_Exit> has the ownership? + int is_owner (void) const; - // Set the ownership of the At_Thread_Exit - int is_owner(int owner); + // Set the ownership of the <At_Thread_Exit>. + int is_owner (int owner); - // This At_Thread_Exit was applied? - int was_applied() const; + // This <At_Thread_Exit> was applied? + int was_applied (void) const; - // Set applied state of At_Thread_Exit - int was_applied(int applied); + // Set applied state of <At_Thread_Exit>. + int was_applied (int applied); protected: - ACE_At_Thread_Exit* next_; - // The next At_Thread_Exit hook in the list. + ACE_At_Thread_Exit *next_; + // The next <At_Thread_Exit> hook in the list. // Do the apply if necessary - void do_apply(); + void do_apply (void); - virtual void apply() = 0; + virtual void apply (void) = 0; // The apply method. ACE_Thread_Descriptor* td_; @@ -125,24 +125,24 @@ class ACE_Export ACE_At_Thread_Exit_Func : public ACE_At_Thread_Exit { public: // Constructor - ACE_At_Thread_Exit_Func(void* object, - ACE_CLEANUP_FUNC func, - void* param = 0); + ACE_At_Thread_Exit_Func (void *object, + ACE_CLEANUP_FUNC func, + void *param = 0); virtual ~ACE_At_Thread_Exit_Func (void); protected: - void* object_; + void *object_; // The object to be cleanup ACE_CLEANUP_FUNC func_; // The cleanup func - void* param_; + void *param_; // A param if required // The apply method - void apply(); + void apply (void); }; #endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ @@ -352,10 +352,10 @@ class ACE_Export ACE_Thread_Manager // correctly, you are probably doing something wrong. Rule of // thumb, use ACE_Thread to manage your daemon threads. // - // Notice that if there're threads live beyond the scope of main (), - // you are sure to have resource leaks in your program. Remember - // to wait on threads before exiting main() if that could happen - // in your programs. + // Notice that if there're threads live beyond the scope of + // <main>, you are sure to have resource leaks in your program. + // Remember to wait on threads before exiting <main> if that + // could happen in your programs. public: friend class ACE_Thread_Control; #if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) @@ -415,14 +415,14 @@ public: int open (size_t size = 0); // No-op. Currently unused. - int close (); + int close (void); // Release all resources. // By default, this method will wait till all threads // exit. However, when called from <close_singleton>, most global resources // are destroyed and thus, we don't try to wait but just clean up the thread // descriptor list. - // The ACE_thread_t * argument to each of the spawn () family member + // The <ACE_thread_t> * argument to each of the <spawn> family member // functions is interpreted and used as shown in the following // table. NOTE: the final option, to provide task names, is _only_ // supported on VxWorks! @@ -501,7 +501,7 @@ public: // failure. If <abandon_detached_threads> is set, wait will first // check thru its thread list for threads with THR_DETACHED or // THR_DAEMON flags set and remove these threads. Notice that - // unlike other wait_* function, by default, wait () does wait on + // unlike other wait_* function, by default, <wait> does wait on // all thread spawned by this thread_manager no matter the detached // flags are set or not unless it is called with // <abandon_detached_threads> flag set. diff --git a/ace/Timeprobe_T.h b/ace/Timeprobe_T.h index 5e327de33bc..1e97bb1cd45 100644 --- a/ace/Timeprobe_T.h +++ b/ace/Timeprobe_T.h @@ -33,7 +33,7 @@ class ACE_Timeprobe // pointer copies are done and the string data is *not* copied. // // The recorded time probes can then be printed by calling - // print_times(). If you have used unsigned longs as event + // <print_times>. If you have used unsigned longs as event // descriptions in any of your time probes, you must have // provided an event description table that maps the unsigned // longs to readable strings. This map is a simple array of @@ -43,7 +43,7 @@ class ACE_Timeprobe // necessary. // // Multiple maps can also be used to chunk up the time probes. - // Each one can be added by calling event_descriptions(). + // Each one can be added by calling <event_descriptions>. // Different tables are used internally by consulting the // minimum_id for each table. It is up to the user to make sure // that multiple tables do not share the same event id range. diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h index 9c619b6ac9f..5e0af5c0b6f 100644 --- a/ace/Timer_Queue_T.h +++ b/ace/Timer_Queue_T.h @@ -278,7 +278,7 @@ public: virtual void return_node (ACE_Timer_Node_T<TYPE> *); // Method used to return a timer node to the queue's ownership - // after it is returned by a method like remove_first () + // after it is returned by a method like <remove_first>. protected: /* virtual */ void upcall (TYPE &type, diff --git a/ace/Token.h b/ace/Token.h index 9d38626a426..18f7e9ac4d6 100644 --- a/ace/Token.h +++ b/ace/Token.h @@ -109,7 +109,7 @@ public: // thing to do (since it makes it possible for shared data to be // changed unexpectedly) so use with caution... // This method maintians the original token priority. - // As in acquire(), the <timeout> value is an absolute time. + // As in <acquire>, the <timeout> value is an absolute time. int tryacquire (void); // Become interface-compliant with other lock mechanisms (implements @@ -154,7 +154,7 @@ public: ACE_thread_t current_owner (void); // Return the id of the current thread that owns the token. - int signal_all_threads (); + int signal_all_threads (void); // Force all threads waiting to acquire the token to return one by // one. The method sets the <signal_all_thread_> to non-zero if // there're threads waiting, and returns the number of threads diff --git a/ace/Token_Collection.h b/ace/Token_Collection.h index 075cee8757d..e85b45e76c4 100644 --- a/ace/Token_Collection.h +++ b/ace/Token_Collection.h @@ -55,7 +55,7 @@ class ACE_Export ACE_Token_Collection : public ACE_Token_Proxy // = BUGS // Although ACE_Token_Collection inherits from ACE_Token_Proxy, it - // can not be including in a collection. This is because clone() + // can not be including in a collection. This is because <clone> // returns zero for now. public: ACE_Token_Collection (int debug = 0, diff --git a/ace/Token_Request_Reply.h b/ace/Token_Request_Reply.h index d08a5a74df5..28501c63678 100644 --- a/ace/Token_Request_Reply.h +++ b/ace/Token_Request_Reply.h @@ -154,7 +154,7 @@ private: // Max micro seconds to wait for token if not blocking forever. ACE_UINT32 arg_; - // value returned in Token_Reply::arg (); + // value returned in <Token_Reply::arg>; char data_[ACE_MAXTOKENNAMELEN + ACE_MAXCLIENTIDLEN + 3]; // The data portion contains the <tokenName_> including a 0 terminator, diff --git a/ace/UPIPE_Connector.h b/ace/UPIPE_Connector.h index 17e78076186..cae79c148ac 100644 --- a/ace/UPIPE_Connector.h +++ b/ace/UPIPE_Connector.h @@ -58,7 +58,7 @@ public: // the default value of <ACE_Addr::sap_any> then the user is letting // the OS do the binding. If <reuse_addr> == 1 then the // <local_addr> is reused, even if it hasn't been cleanedup yet. - // The <flags> and <perms> arguments are passed down to the open() + // The <flags> and <perms> arguments are passed down to the <open> // method. int connect (ACE_UPIPE_Stream &new_stream, @@ -81,7 +81,7 @@ public: // the default value of <ACE_Addr::sap_any> then the user is letting // the OS do the binding. If <reuse_addr> == 1 then the // <local_addr> is reused, even if it hasn't been cleanedup yet. - // The <flags> and <perms> arguments are passed down to the open() + // The <flags> and <perms> arguments are passed down to the <open> // method. int reset_new_handle (ACE_HANDLE handle); diff --git a/ace/WFMO_Reactor.h b/ace/WFMO_Reactor.h index a9863b094d4..4cbb941312e 100644 --- a/ace/WFMO_Reactor.h +++ b/ace/WFMO_Reactor.h @@ -400,7 +400,7 @@ class ACE_Export ACE_WFMO_Reactor_Notify : public ACE_Reactor_Notify // This implementation is necessary for cases where the // <ACE_WFMO_Reactor> is run in a multi-threaded program. In // this case, we need to be able to unblock - // WaitForMultipleObjects() when updates occur other than in the + // <WaitForMultipleObjects> when updates occur other than in the // main <ACE_WFMO_Reactor> thread. To do this, we signal an // auto-reset event the <ACE_WFMO_Reactor> is listening on. If // an <ACE_Event_Handler> and <ACE_Reactor_Mask> is passed to @@ -510,9 +510,10 @@ class ACE_Export ACE_WFMO_Reactor : public ACE_Reactor_Impl // handle_close on the handler when it is finally removed and // not when remove_handler is called. If the handler is not // going to be around when the WFMO_Reactor calls - // handler->handle_close(), use the DONT_CALL flag with - // remove_handler(). Or else, dynamically allocate the handler, - // and then call "delete this" inside handler->handle_close(). + // <ACE_Event_Handler::handle_close>, use the DONT_CALL flag + // with <remove_handler>. Or else, dynamically allocate the + // handler, and then call "delete this" inside + // <ACE_Event_Handler::handle_close>. public: friend class ACE_WFMO_Reactor_Handler_Repository; friend class ACE_WFMO_Reactor_Test; @@ -728,7 +729,7 @@ public: virtual int suspend_handler (ACE_Event_Handler *event_handler); // Suspend <event_handler> temporarily. Use - // <event_handler->get_handle()> to get the handle. + // <ACE_Event_Handler::get_handle> to get the handle. virtual int suspend_handler (ACE_HANDLE handle); // Suspend <handle> temporarily. @@ -740,8 +741,8 @@ public: // Suspend all <handles> temporarily. virtual int resume_handler (ACE_Event_Handler *event_handler); - // Resume <event_handler>. Use <event_handler->get_handle()> to get - // the handle. + // Resume <event_handler>. Use <ACE_Event_Handler::get_handle> to + // get the handle. virtual int resume_handler (ACE_HANDLE handle); // Resume <handle>. @@ -945,7 +946,7 @@ protected: virtual int ok_to_wait (ACE_Time_Value *max_wait_time, int alertable); - // Check to see if it is ok to enter ::WaitForMultipleObjects(). + // Check to see if it is ok to enter <::WaitForMultipleObjects>. virtual int wait_for_multiple_events (int timeout, int alertable); diff --git a/examples/Reactor/Misc/notification.cpp b/examples/Reactor/Misc/notification.cpp index e7850ebd371..556ed24089b 100644 --- a/examples/Reactor/Misc/notification.cpp +++ b/examples/Reactor/Misc/notification.cpp @@ -27,10 +27,21 @@ class Thread_Handler : public ACE_Event_Handler // thread exits it notifies the ACE_Reactor in the main thread // using the ACE_Reactor's notification mechanism. public: - Thread_Handler (int delay, int interval, size_t n_threads); - Thread_Handler (size_t id): id_ (id) {} + Thread_Handler (int delay, + int interval, + size_t n_threads, + size_t max_iterations); + // Constructor. - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); + Thread_Handler (size_t id, + size_t max_iterations); + + ~Thread_Handler (void); + // Destructor. + + virtual int handle_signal (int signum, + siginfo_t * = 0, + ucontext_t * = 0); // Handle signals. virtual int handle_exception (ACE_HANDLE); @@ -81,11 +92,26 @@ ACE_Time_Value Thread_Handler::delay_; // Interval factor for Event_Handler timer. ACE_Time_Value Thread_Handler::interval_; +Thread_Handler::Thread_Handler (size_t id, + size_t max_iterations) + : id_ (id), + iterations_ (max_iterations) +{ +} + +Thread_Handler::~Thread_Handler (void) +{ + // Cleanup resources so that we don't crash and burn when shutdown. + ACE_Event_Handler::remove_stdin_handler (ACE_Reactor::instance (), + ACE_Thread_Manager::instance ()); + ACE_Reactor::instance ()->cancel_timer (this); +} Thread_Handler::Thread_Handler (int delay, int interval, - size_t n_threads) - : iterations_(MAX_ITERATIONS) + size_t n_threads, + size_t max_iterations) + : iterations_ (max_iterations) { ACE_Sig_Set sig_set; @@ -99,28 +125,48 @@ Thread_Handler::Thread_Handler (int delay, if (ACE_Event_Handler::register_stdin_handler (this, ACE_Reactor::instance (), ACE_Thread_Manager::instance ()) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "register_stdin_handler")); - else if (ACE_Reactor::instance ()->register_handler (sig_set, this) == -1) - ACE_ERROR ((LM_ERROR, "(%t) %p\n", "register_handler")); + ACE_ERROR ((LM_ERROR, + "%p\n", + "register_stdin_handler")); + else if (ACE_Reactor::instance ()->register_handler (sig_set, + this) == -1) + ACE_ERROR ((LM_ERROR, + "(%t) %p\n", + "register_handler")); else if (ACE_Reactor::instance ()->schedule_timer - (this, 0, Thread_Handler::delay_, Thread_Handler::interval_) == -1) - ACE_ERROR ((LM_ERROR, "(%t) %p\n", "schedule_timer")); + (this, + 0, + Thread_Handler::delay_, + Thread_Handler::interval_) == -1) + ACE_ERROR ((LM_ERROR, + "(%t) %p\n", + "schedule_timer")); - // Set up this thread's signal mask, which is inherited by the - // threads it spawns. - - ACE_Thread::sigsetmask (SIG_BLOCK, sig_set); + // Set up this thread's signal mask to block all the signal in the + // <sig_set>, which is inherited by the threads it spawns. + ACE_Sig_Guard guard (&sig_set); // Create N new threads of control Thread_Handlers. for (size_t i = 0; i < n_threads; i++) - if (ACE_Thread::spawn ((ACE_THR_FUNC) &Thread_Handler::svc_run, - new Thread_Handler (i + 1), - THR_NEW_LWP | THR_DETACHED) != 0) - ACE_ERROR ((LM_ERROR, "%p\n", "ACE_Thread::spawn")); + { + Thread_Handler *th; + + ACE_NEW (th, + Thread_Handler (i + 1, + this->iterations_)); + + if (ACE_Thread::spawn (ACE_reinterpret_cast (ACE_THR_FUNC, + &Thread_Handler::svc_run), + ACE_reinterpret_cast (void *, th), + THR_NEW_LWP | THR_DETACHED) != 0) + ACE_ERROR ((LM_ERROR, + "%p\n", + "ACE_Thread::spawn")); + } - // Unblock signal set so that only this thread receives them! - ACE_Thread::sigsetmask (SIG_UNBLOCK, sig_set); + // The destructor of <guard> unblocks the signal set so that only + // this thread receives them! } int @@ -130,19 +176,27 @@ Thread_Handler::notify (ACE_Time_Value *timeout) // capabilities... if (ACE_Reactor::instance ()->notify - (this, ACE_Event_Handler::EXCEPT_MASK, timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", - "notification::notify:exception"), -1); + (this, + ACE_Event_Handler::EXCEPT_MASK, + timeout) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%t) %p\n", + "notification::notify:exception"), + -1); else if (ACE_Reactor::instance ()->notify - (this, ACE_Event_Handler::WRITE_MASK, timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", - "notification::notify:write"), -1); - + (this, + ACE_Event_Handler::WRITE_MASK, + timeout) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%t) %p\n", + "notification::notify:write"), + -1); return 0; } -// Test stdin handling (can use select to demultiplex HANDLEs) -// Input is only handled by the main thread +// Test stdin handling that uses <select> to demultiplex HANDLEs. +// Input is only handled by the main thread. + int Thread_Handler::handle_input (ACE_HANDLE handle) { @@ -151,16 +205,22 @@ Thread_Handler::handle_input (ACE_HANDLE handle) if (n > 0) { - ACE_DEBUG ((LM_DEBUG, "input to (%t) %*s", - n, buf)); + ACE_DEBUG ((LM_DEBUG, + "input to (%t) %*s", + n, + buf)); + + ACE_DEBUG ((LM_DEBUG, + "%d more input to kill\n", + this->iterations_)); - ACE_DEBUG ((LM_DEBUG, "%d more input to kill\n", - iterations_)); // Only wait up to 10 milliseconds to notify the Reactor. - ACE_Time_Value timeout (0, 10 * 1000); + ACE_Time_Value timeout (0, + 10 * 1000); if (this->notify (&timeout) == -1) - ACE_ERROR ((LM_DEBUG, "(%t), %p\n", + ACE_ERROR ((LM_DEBUG, + "(%t), %p\n", "notification::handle_input:notify")); return 0; } @@ -174,23 +234,33 @@ Thread_Handler::handle_input (ACE_HANDLE handle) int Thread_Handler::svc (void) { - iterations_ = MAX_ITERATIONS; + ACE_Time_Value sleep_timeout (0, + // Transform this into microseconds and divide by 2. + (Thread_Handler::interval_.sec () * ACE_ONE_SECOND_IN_USECS) / 2); - while (this->shutdown_ == 0 && --iterations_ > 0 ) + for (int i = this->iterations_; + i > 0; + --i) { - if (Thread_Handler::delay_.sec () > 0) - // Block for delay_.secs () / 2, then notify the Reactor. - ACE_OS::sleep (Thread_Handler::delay_.sec () / 2); + if (this->shutdown_ != 0) + break; - // Only wait up to 10 milliseconds to notify the Reactor. - ACE_Time_Value timeout (0, 10 * 1000); + // Block for delay_.secs () / 2, then notify the Reactor. + ACE_OS::sleep (sleep_timeout); - if (notify (&timeout) == -1) - ACE_ERROR ((LM_ERROR, "(%t) %p\n", "notify")); + // Wait up to 10 milliseconds to notify the Reactor. + ACE_Time_Value timeout (0, + 10 * 1000); + if (this->notify (&timeout) == -1) + ACE_ERROR ((LM_ERROR, + "(%t) %p\n", + "notify")); } - ACE_Reactor::instance ()->remove_handler(this, ALL_EVENTS_MASK); - ACE_DEBUG ((LM_DEBUG, "(%t) exiting svc\n")); + ACE_Reactor::instance ()->remove_handler (this, + ALL_EVENTS_MASK); + ACE_DEBUG ((LM_DEBUG, + "(%t) exiting svc\n")); return 0; } @@ -222,11 +292,15 @@ int Thread_Handler::handle_timeout (const ACE_Time_Value &time, const void *) { - ACE_DEBUG ((LM_DEBUG, "(%t) received timeout at (%u, %u)\n", - time.sec (), time.usec ())); + ACE_DEBUG ((LM_DEBUG, + "(%t) received timeout at (%u, %u), iterations = %d\n", + time.sec (), + time.usec (), + this->iterations_)); - if (--iterations_ <= 0) - ACE_Reactor::end_event_loop(); + if (--this->iterations_ <= 0 + || Thread_Handler::interval_.sec () == 0) + ACE_Reactor::end_event_loop (); return 0; } @@ -237,8 +311,9 @@ int Thread_Handler::handle_exception (ACE_HANDLE) { ACE_DEBUG ((LM_DEBUG, - "(%t) exception to id %d\n", - this->id_)); + "(%t) exception to id %d, iteration = %d\n", + this->id_, + this->iterations_)); return 0; } @@ -248,8 +323,11 @@ int Thread_Handler::handle_output (ACE_HANDLE) { ACE_DEBUG ((LM_DEBUG, - "(%t) output to id %d\n", - this->id_)); + "(%t) output to id %d, iteration = %d\n", + this->id_, + // This decrement must come last since + // <handle_exception> is called before <handle_output>! + this->iterations_--)); return 0; } @@ -258,30 +336,40 @@ Thread_Handler::handle_output (ACE_HANDLE) void * Thread_Handler::svc_run (void *eh) { - Thread_Handler *this_handler = (Thread_Handler *) eh; + Thread_Handler *this_handler = + ACE_reinterpret_cast (Thread_Handler *, eh); - return this_handler->svc () == 0 ? 0 : (void *) -1; + if (this_handler->svc () == 0) + return 0; + else + return ACE_reinterpret_cast (void *, -1); } int main (int argc, char *argv[]) { - // Required to initialize the Service Configurator. - ACE_Service_Config daemon (argv[0]); + ACE_LOG_MSG->open (argv[0]); - if (argc != 4) + if (argc < 4) ACE_ERROR ((LM_ERROR, - "usage: %s delay interval n_threads%a\n", - argv[0], 1)); + "usage: %s delay interval n_threads [iterations]%a\n", + argv[0], + 1)); int delay = ACE_OS::atoi (argv[1]); int interval = ACE_OS::atoi (argv[2]); size_t n_threads = ACE_OS::atoi (argv[3]); + size_t max_iterations = argc > 4 ? ACE_OS::atoi (argv[4]) : MAX_ITERATIONS; - Thread_Handler thr_handler (delay, interval, n_threads); + Thread_Handler thr_handler (delay, + interval, + n_threads, + max_iterations); ACE_Reactor::run_event_loop (); - ACE_DEBUG ((LM_DEBUG, "exiting from main%a\n", 1)); + + ACE_DEBUG ((LM_DEBUG, + "exiting from main\n")); return 0; } #else @@ -289,6 +377,6 @@ int main (int, char *[]) { ACE_ERROR_RETURN ((LM_ERROR, - "threads not supported on this platform\n"), -1); + "threads must be supported to run this application\n"), -1); } #endif /* ACE_HAS_THREADS */ diff --git a/examples/Shared_Malloc/test_position_independent_malloc.cpp b/examples/Shared_Malloc/test_position_independent_malloc.cpp index 843310da32e..af2511fcbae 100644 --- a/examples/Shared_Malloc/test_position_independent_malloc.cpp +++ b/examples/Shared_Malloc/test_position_independent_malloc.cpp @@ -11,7 +11,6 @@ ACE_RCSID(Shared_Malloc, test_multiple_mallocs, "$Id$") -#if 0 typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC; // Default address for memory-mapped files. @@ -208,12 +207,3 @@ template class ACE_Based_Pointer_Basic<Dummy_Data>; #pragma instantiate ACE_Based_Pointer<Dummy_Data> #pragma instantiate ACE_Based_Pointer_Basic<Dummy_Data> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#else -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "sorry, example not finished yet\n"), - 1); -} -#endif /* 0 */ |