3 #include "tao/ORB_Core.h"
5 // Set the ORB pointer, register OBV factories and init the
6 // lists declared above.
9 Checkpoint_i::orb (CORBA::ORB_ptr o
)
11 this->orb_
= CORBA::ORB::_duplicate (o
);
13 TAO_OBV_REGISTER_FACTORY (Event_factory
, Event
);
17 // Sidebar on assignment from pointer to _var type.
19 // Event_var e_var (event);
20 // This is fatal because the reference counter in *event is not increased
21 // when a pointer is assigned to a _var. (This happens only
22 // in assignments from another Event_var;
23 // But Assignment from new is fine, the referencecount is yet one.)
26 // CORBA::add_ref (event);
27 // Event_var e_var (event);
29 // but possibly easier to read it a macro
30 #define DUP_REF(vt_ptr) (CORBA::add_ref (vt_ptr), vt_ptr)
31 // then it reads: Event_var e_var (DUP_REF (event));
32 // (But it may cause desaster if vt_ptr is a function call.)
34 // Be careful with assignments from T1_var to T2_var, if T1 and T2 are
35 // related through inheritance. Because there are many implicit casts
36 // between pointer and _var types possible, the reference counter of
37 // the duplicated reference is not increased.
39 // Is there any general solution with faulty reference counting ?
43 Checkpoint_i::put_event (Event
*event
)
45 // Let us see what event has arrived
49 // Shutdown the server application.
52 Checkpoint_i::shutdown ()
55 "\nThe Checkpoint server is shutting down\n"));
57 // Instruct the ORB to shutdown.
58 this->orb_
->shutdown ();
62 Checkpoint_i::Checkpoint_i ()
67 Checkpoint_i::~Checkpoint_i ()