summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_Proxy_T.cpp
blob: 90f946d3ec4e2f631b775af1aaa6e8941b482d4a (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
// $Id$

#ifndef TAO_NOTIFY_PROXY_T_C
#define TAO_NOTIFY_PROXY_T_C

#include "Notify_Proxy_T.h"
#include "Notify_Event_Manager.h"

#include "tao/debug.h"

ACE_RCSID(Notify, Notify_Proxy_T, "$Id$")

template <class SERVANT_TYPE>
TAO_Notify_Proxy<SERVANT_TYPE>::TAO_Notify_Proxy (void)
  :lock_ (0),
   refcount_ (1),
   is_connected_ (0),
   updates_on_ (1)
{
  // No-Op.
}

// Implementation skeleton destructor
template <class SERVANT_TYPE>
TAO_Notify_Proxy<SERVANT_TYPE>::~TAO_Notify_Proxy (void)
{
  if (TAO_debug_level > 0)
    ACE_DEBUG ((LM_DEBUG, "in ~TAO_Notify_Proxy\n"));
}

template <class SERVANT_TYPE> CORBA::ULong
TAO_Notify_Proxy<SERVANT_TYPE>::_incr_refcnt (void)
{
  ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
  return this->refcount_++;
}

template <class SERVANT_TYPE> CORBA::ULong
TAO_Notify_Proxy<SERVANT_TYPE>::_decr_refcnt (void)
{
  {
    ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
    this->refcount_--;
    if (this->refcount_ != 0)
      return this->refcount_;
  }

  delete this;
  return 0;
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::_add_ref (TAO_ENV_SINGLE_ARG_DECL_NOT_USED/*TAO_ENV_SINGLE_ARG_PARAMETER*/)
{
  this->_incr_refcnt ();
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::_remove_ref (TAO_ENV_SINGLE_ARG_DECL_NOT_USED/*TAO_ENV_SINGLE_ARG_PARAMETER*/)
{
  this->_decr_refcnt ();
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::dispatch_update (TAO_Notify_EventType_List& added_list, TAO_Notify_EventType_List& removed_list TAO_ENV_ARG_DECL)
{
  CosNotification::EventTypeSeq added (added_list.size ());
  CosNotification::EventTypeSeq removed (removed_list.size ());

  added_list.populate (added);
  removed_list.populate (removed);

  this->dispatch_update_i (added, removed TAO_ENV_ARG_PARAMETER);
}

template <class SERVANT_TYPE> CosNotifyChannelAdmin::ProxyType
TAO_Notify_Proxy<SERVANT_TYPE>::MyType (TAO_ENV_SINGLE_ARG_DECL_NOT_USED/*TAO_ENV_SINGLE_ARG_PARAMETER*/)
  ACE_THROW_SPEC ((
                   CORBA::SystemException
                   ))
{
  return proxy_type_;
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::validate_event_qos (const CosNotification::QoSProperties & /*required_qos*/, CosNotification::NamedPropertyRangeSeq_out /*available_qos*/ TAO_ENV_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException,
                   CosNotification::UnsupportedQoS
                   ))
{
  ACE_THROW (CORBA::NO_IMPLEMENT ());
}

template <class SERVANT_TYPE> CosNotification::QoSProperties*
TAO_Notify_Proxy<SERVANT_TYPE>::get_qos (TAO_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException
                   ))
{
  return this->qos_admin_.get_qos (TAO_ENV_SINGLE_ARG_PARAMETER);
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::set_qos (const CosNotification::QoSProperties & qos TAO_ENV_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException,
                   CosNotification::UnsupportedQoS
                   ))
{
  this->qos_admin_.set_qos (qos TAO_ENV_ARG_PARAMETER);
  ACE_CHECK;

  this->setup_qos_policies (TAO_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK;
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::validate_qos (
    const CosNotification::QoSProperties & required_qos,
    CosNotification::NamedPropertyRangeSeq_out available_qos
    TAO_ENV_ARG_DECL
    )
  ACE_THROW_SPEC ((
                   CORBA::SystemException,
                   CosNotification::UnsupportedQoS
                   ))
{
  this->qos_admin_.validate_qos (required_qos, available_qos TAO_ENV_ARG_PARAMETER);
}

template <class SERVANT_TYPE> CosNotifyFilter::FilterID
TAO_Notify_Proxy<SERVANT_TYPE>::add_filter (CosNotifyFilter::Filter_ptr new_filter TAO_ENV_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException
                   ))
{
  return this->filter_admin_.add_filter (new_filter TAO_ENV_ARG_PARAMETER);
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::remove_filter (
    CosNotifyFilter::FilterID filter
    TAO_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
                   CORBA::SystemException,
                   CosNotifyFilter::FilterNotFound
                   ))
{
  this->filter_admin_.remove_filter (filter TAO_ENV_ARG_PARAMETER);
}

template <class SERVANT_TYPE> CosNotifyFilter::Filter_ptr
TAO_Notify_Proxy<SERVANT_TYPE>::get_filter (CosNotifyFilter::FilterID filter TAO_ENV_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException,
                   CosNotifyFilter::FilterNotFound
                   ))
{
  return this->filter_admin_.get_filter (filter TAO_ENV_ARG_PARAMETER);
}

template <class SERVANT_TYPE> CosNotifyFilter::FilterIDSeq*
TAO_Notify_Proxy<SERVANT_TYPE>::get_all_filters (TAO_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException
                   ))
{
  return this->filter_admin_.get_all_filters (TAO_ENV_SINGLE_ARG_PARAMETER);
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::remove_all_filters (TAO_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((
                   CORBA::SystemException
                   ))
{
  this->filter_admin_.remove_all_filters (TAO_ENV_SINGLE_ARG_PARAMETER);
}

template <class SERVANT_TYPE> const TAO_Notify_QoSAdmin_i&
TAO_Notify_Proxy<SERVANT_TYPE>::qos_admin (void) const
{
  return this->qos_admin_;
}

template <class SERVANT_TYPE> void
TAO_Notify_Proxy<SERVANT_TYPE>::setup_qos_policies (
                                  TAO_ENV_SINGLE_ARG_DECL)
{
  this->filter_admin_.remove_all_filters (TAO_ENV_SINGLE_ARG_PARAMETER);
}

#endif /* TAO_NOTIFY_PROXY_T_C */