summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp
blob: c0de22b6a02d02a52ce5e05583a294342ff87725 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// $Id$

#include "EC_Null_Factory.h"
#include "EC_Dispatching.h"
#include "EC_Filter_Builder.h"
#include "EC_ConsumerAdmin.h"
#include "EC_SupplierAdmin.h"
#include "EC_ProxyConsumer.h"
#include "EC_ProxySupplier.h"
#include "EC_SupplierFiltering.h"
#include "Timer_Module.h"

#if ! defined (__ACE_INLINE__)
#include "EC_Null_Factory.i"
#endif /* __ACE_INLINE__ */

ACE_RCSID(Event, EC_Null_Factory, "$Id$")

TAO_EC_Null_Factory::~TAO_EC_Null_Factory (void)
{
  delete this->supplier_filtering_;
  this->supplier_filtering_ = 0;
}

TAO_EC_Dispatching*
TAO_EC_Null_Factory::create_dispatching (TAO_EC_Event_Channel *)
{
  return new TAO_EC_Reactive_Dispatching ();
}

void
TAO_EC_Null_Factory::destroy_dispatching (TAO_EC_Dispatching *x)
{
  delete x;
}

TAO_EC_Filter_Builder*
TAO_EC_Null_Factory::create_filter_builder (TAO_EC_Event_Channel *)
{
  return new TAO_EC_Null_Filter_Builder;
}

void
TAO_EC_Null_Factory::destroy_filter_builder (TAO_EC_Filter_Builder *x)
{
  delete x;
}

TAO_EC_ConsumerAdmin*
TAO_EC_Null_Factory::create_consumer_admin (TAO_EC_Event_Channel *ec)
{
  return new TAO_EC_ConsumerAdmin (ec);
}

void
TAO_EC_Null_Factory::destroy_consumer_admin (TAO_EC_ConsumerAdmin *x)
{
  delete x;
}

TAO_EC_SupplierAdmin*
TAO_EC_Null_Factory::create_supplier_admin (TAO_EC_Event_Channel *ec)
{
  return new TAO_EC_SupplierAdmin (ec);
}

void
TAO_EC_Null_Factory::destroy_supplier_admin (TAO_EC_SupplierAdmin *x)
{
  delete x;
}

TAO_EC_ProxyPushSupplier*
TAO_EC_Null_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel *ec)
{
  return new TAO_EC_ProxyPushSupplier (ec);
}

void
TAO_EC_Null_Factory::destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier *x)
{
  delete x;
}

TAO_EC_ProxyPushConsumer*
TAO_EC_Null_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel *ec)
{
  if (this->supplier_filtering_ == 0)
    ACE_NEW_RETURN (this->supplier_filtering_,
                    TAO_EC_Null_SupplierFiltering (ec),
                    0);
  return new TAO_EC_ProxyPushConsumer (ec, this->supplier_filtering_);
}

void
TAO_EC_Null_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x)
{
  delete x;
}

TAO_EC_Timer_Module*
TAO_EC_Null_Factory::create_timer_module (TAO_EC_Event_Channel *ec)
{
  // @@ TODO fixme
  TAO_ORB_Core* orb_core = TAO_ORB_Core_instance ();
  return new TAO_EC_ST_Timer_Module (orb_core->reactor ());
}

void
TAO_EC_Null_Factory::destroy_timer_module (TAO_EC_Timer_Module *x)
{
  delete x;
}

PortableServer::POA_ptr
TAO_EC_Null_Factory::consumer_poa (CORBA::Environment&)
{
  return PortableServer::POA::_duplicate (this->poa_.in ());
}

PortableServer::POA_ptr
TAO_EC_Null_Factory::supplier_poa (CORBA::Environment&)
{
  return PortableServer::POA::_duplicate (this->poa_.in ());
}