Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Naming / Nodelocal.cpp
blobac3c91e22ee30ba5d765e5275bba936d02b957c2
1 #include "Naming_Context.h"
2 #include "Temperature_Monitor.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 // Listing 1
11 // Listing 2 code/ch21
12 Naming_Context naming_context;
14 ACE_Name_Options *name_options = naming_context.name_options();
15 // Listing 2
17 // Listing 3 code/ch21
18 ACE_TCHAR *naming_options_argv[] = { argv[0] };
19 name_options->parse_args
20 (sizeof(naming_options_argv) / sizeof(ACE_TCHAR*),
21 naming_options_argv);
22 name_options->context (ACE_Naming_Context::PROC_LOCAL);
23 naming_context.open (name_options->context ());
24 // Listing 3
26 // Listing 4 code/ch21
27 Temperature_Monitor temperature_monitor (opt, naming_context);
28 temperature_monitor.monitor ();
29 // Listing 4
31 // Listing 5 code/ch21
32 naming_context.close ();
33 return 0;
34 // Listing 5