Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Naming / Nodelocal_shared.cpp
blobea612ba8d26965b52fd4be8e4002e2a16528b567
1 #include "Naming_Context.h"
2 #include "Temperature_Monitor2.h"
3 #include "Temperature_Monitor_Options.h"
5 // Listing 1 code/ch21
6 int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
8 Temperature_Monitor_Options opt (argc, argv);
9 Naming_Context process_context;
11 ACE_Name_Options *name_options =
12 process_context.name_options ();
13 name_options->context (ACE_Naming_Context::PROC_LOCAL);
14 ACE_TCHAR *nargv[] = { argv[0] };
15 name_options->parse_args (sizeof(nargv) / sizeof(ACE_TCHAR*) ,
16 nargv);
17 process_context.open (name_options->context ());
20 Naming_Context shared_context;
22 ACE_Name_Options *name_options =
23 shared_context.name_options ();
24 name_options->process_name (argv[0]);
25 name_options->context (ACE_Naming_Context::NODE_LOCAL);
26 shared_context.open (name_options->context ());
29 Temperature_Monitor2 temperature_monitor (opt,
30 process_context,
31 shared_context);
32 temperature_monitor.monitor ();
34 process_context.close ();
35 shared_context.close ();
37 return 0;
39 // Listing 1