summaryrefslogtreecommitdiff
path: root/TAO/examples/Event_Comm/Notifier_Handler.cpp
blob: a3abcf5a6f2673fb8b0b0218668433af5eae8bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// $Id$

#include "Notifier_Handler.h"

ACE_RCSID(Supplier, Notifier_Handler, "$Id$")

int
Notifier_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
{
  if (this->notifier_ != 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "closing down Notifier_Handler\n"));
      CORBA::release (this->notifier_);
      this->notifier_ = 0;
      // *Must* be allocated dyanmically!
      ::operator delete ((void *) this);
    }

  return 0;
}

Event_Comm::Notifier *
Notifier_Handler::notifier (void)
{
  return this->notifier_;
}

void
Notifier_Handler::notifier (Event_Comm::Notifier *notifier)
{
  if (this->notifier_ != notifier)
    {
      CORBA::release (this->notifier_);
      this->notifier_ = notifier;
    }
}

Notifier_Handler::Notifier_Handler()
{
  // get the notifier from the naming service.
}

// Create and initialize a Notifier target object.
Notifier_Handler::Notifier_Handler (const char *service_location,
				    const char *marker,
				    int putit)
{
  // Create a notifier object using the implementation class
  // Notifier_i.
  /*ACE_NEW (this->notifier_,
           TIE_Event_Comm_Notifier (Notifier_i) (new Notifier_i,
                                                 marker));
  */
  //@@ declare and orb and a notifir_var in the .h
  // init the orb, register the object with the orb and the naming service
}

// Destroy a Notifier target object.

Notifier_Handler::~Notifier_Handler (void)
{
  this->handle_close ();
}