=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / examples / Borland / ORBThread.cpp
blob0abef8cdf12cd792a61b3e533362cbf552119251
1 //---------------------------------------------------------------------------
2 // To be able to handle CORBA requests an application usually calls orb->run().
3 // To integrate this into VCL applications we will run the orb in a separate
4 // thread. The ability to run the orb in a thread other than the main thread is
5 // a non-standard extension to CORBA provided by TAO. If you would rather use
6 // strictly standard CORBA calls, you need to add the code:
7 //
8 // if (orb->work_pending())
9 // orb->perform_work();
11 // somewhere into your application's event loop.
13 // Note that a "pure" client application (one that does not handle requests
14 // from any other application) need not do either of these things.
15 //---------------------------------------------------------------------------
16 #include "pch.h"
17 #pragma hdrstop
18 #include "ORBThread.h"
19 //---------------------------------------------------------------------------
20 __fastcall TORBThread::TORBThread (CORBA::ORB_ptr orb)
21 : TThread (true),
22 orb_ (CORBA::ORB::_duplicate (orb))
24 Resume ();
26 //---------------------------------------------------------------------------
27 __fastcall TORBThread::~TORBThread ()
29 try
31 orb_->shutdown (false);
33 catch (const CORBA::Exception&)
37 WaitFor ();
39 //---------------------------------------------------------------------------
40 void __fastcall TORBThread::Execute ()
42 try
44 orb_->run ();
46 catch (const CORBA::Exception& e)
48 ShowMessage (e._rep_id ());
49 Application->Terminate ();
52 //---------------------------------------------------------------------------