summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp
blob: 4eaaa2555b95cb4a3f5ce0881ec5cf23c63538cd (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
// $Id$

#include "AnyEvent.h"

#if ! defined (__ACE_INLINE__)
#include "AnyEvent.inl"
#endif /* __ACE_INLINE__ */

ACE_RCSID(Notify, TAO_NS_AnyEvent, "$id$")

#include "../Consumer.h"
#include "tao/debug.h"

TAO_NS_EventType TAO_NS_AnyEvent::event_type_;

TAO_NS_AnyEvent::TAO_NS_AnyEvent (const CORBA::Any &event)
  : event_ (event)
{
}

TAO_NS_AnyEvent::~TAO_NS_AnyEvent ()
{
}

const TAO_NS_EventType&
TAO_NS_AnyEvent::type (void) const
{
  return this->event_type_;
}

void
TAO_NS_AnyEvent::convert (CosNotification::StructuredEvent& notification)
{
  TAO_NS_Event::translate (this->event_, notification);
}

CORBA::Boolean
TAO_NS_AnyEvent::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL)
{
  if (TAO_debug_level > 0)
    ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - "
                "TAO_Notify_AnyEvent::do_match ()\n"));

  return filter->match(this->event_ ACE_ENV_ARG_PARAMETER);
}

void
TAO_NS_AnyEvent::push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const
{
  if (TAO_debug_level > 0)
    ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - "
                "TAO_Notify_AnyEvent::push \n"));

  consumer->push (this->event_ ACE_ENV_ARG_PARAMETER);
}

void
TAO_NS_AnyEvent::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL)
{
  CosNotification::StructuredEvent notification;

  TAO_NS_Event::translate (this->event_, notification);

  forwarder->forward_structured (notification ACE_ENV_ARG_PARAMETER);
}

void
TAO_NS_AnyEvent::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL)
{
  CosNotification::StructuredEvent notification;

  TAO_NS_Event::translate (this->event_, notification);

  forwarder->forward_structured_no_filtering (notification ACE_ENV_ARG_PARAMETER);
}

void
TAO_NS_AnyEvent::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL)
{
  forwarder->forward_any (this->event_ ACE_ENV_ARG_PARAMETER);
}

void
TAO_NS_AnyEvent::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL)
{
  forwarder->forward_any_no_filtering (this->event_ ACE_ENV_ARG_PARAMETER);
}