Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / Trading_Service / Trading_Service.cpp
blob06f3f6b3dee4fb33edb876cafaade7d52c16a057
1 #include "orbsvcs/Log_Macros.h"
2 #include "ace/Arg_Shifter.h"
3 #include "Trading_Service.h"
5 Trading_Shutdown::Trading_Shutdown (Trading_Service& trader)
6 : trader_ (trader)
8 if (this->shutdown_.register_handler (SIGINT,
9 this) == -1)
10 ORBSVCS_ERROR ((LM_ERROR,
11 ACE_TEXT("%p\n"),
12 ACE_TEXT("register_handler")));
14 if (this->shutdown_.register_handler (SIGTERM,
15 this) == -1)
16 ORBSVCS_ERROR ((LM_ERROR,
17 ACE_TEXT("%p\n"),
18 ACE_TEXT("register_handler")));
21 int
22 Trading_Shutdown::handle_signal (int,
23 siginfo_t *,
24 ucontext_t *)
26 this->trader_.~Trading_Service ();
27 ACE_OS::exit (0);
28 return 0;
31 Trading_Service::~Trading_Service ()
33 this->shutdown ();
36 int
37 Trading_Service::init (int argc, ACE_TCHAR *argv[])
39 int const result_trader = this->trading_loader_.init (argc, argv);
41 if (result_trader == -1)
42 return -1;
44 return 0;
47 int
48 Trading_Service::run ()
50 Trading_Shutdown trading_shutdown (*this);
52 return this->trading_loader_.run ();
55 int
56 Trading_Service::shutdown ()
58 // Invoke TAO_Trading_Loader::fini ()
59 int const shutdown_result = this->trading_loader_.fini ();
61 if (shutdown_result == -1)
62 return -1;
64 return 0;