summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.cpp
blob: f05dad97be847ed20823b9220341bac2efc0a5f1 (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
#include "StructuredEvent.h"


TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent ()
{
}

TAO_Notify_Tests_StructuredEvent::~TAO_Notify_Tests_StructuredEvent ()
{
}

TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (const char* name)
{
  event_.header.fixed_header.event_name = CORBA::string_dup(name);
}

TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (const char* domain, const char* type)
{
  event_.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain);
  event_.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
}

TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (const char* name, const char* domain, const char* type)
{
  event_.header.fixed_header.event_name = CORBA::string_dup(name);
  event_.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain);
  event_.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
}

void
TAO_Notify_Tests_StructuredEvent::name (const char* name)
{
  event_.header.fixed_header.event_name = CORBA::string_dup(name);
}

void
TAO_Notify_Tests_StructuredEvent::type (const char* domain, const char* type)
{
  event_.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain);
  event_.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
}

const char*
TAO_Notify_Tests_StructuredEvent::type ()
{
  return event_.header.fixed_header.event_type.type_name;
}

void
TAO_Notify_Tests_StructuredEvent::opt_header (const char* name, CORBA::Any& value)
{
  CosNotification::PropertySeq& opt =  event_.header.variable_header;
  opt.length (opt.length () + 1);

  opt[opt.length () - 1].name = CORBA::string_dup (name);
  opt[opt.length () - 1].value = value;
}

void
TAO_Notify_Tests_StructuredEvent::filter (const char* name, CORBA::Any& value)
{
  CosNotification::PropertySeq& filter = event_.filterable_data;
  filter.length (filter.length () + 1);

  filter[filter.length () - 1].name = CORBA::string_dup (name);
  filter[filter.length () - 1].value = value;
}

void
TAO_Notify_Tests_StructuredEvent::qos (const char* name, CORBA::Any& value)
{
  this->opt_header (name, value);
}

void
TAO_Notify_Tests_StructuredEvent::payload (CORBA::Any& value)
{
  event_.remainder_of_body = value;
}

CosNotification::StructuredEvent&
TAO_Notify_Tests_StructuredEvent::event ()
{
  return this->event_;
}