summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.idl
blob: 851ed0ad11ee4fa3651a6f1e0e88577d2e6240ff (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
/**
 * @file   VTopic_Base.idl
 * @author Marijke Hengstmengel (mhengstmengel@remedy.nl)
 */

#ifndef VTOPIC_BASE_IDL
#define VTOPIC_BASE_IDL

#pragma ndds typesupport "Base/VTopic_BaseSupport.h"
#pragma opendds typesupport "Base/VTopic_BaseTypeSupportImpl.h"

typedef octet octet_array[5];

#pragma DCPS_DATA_TYPE "TestTopic"
#pragma DCPS_DATA_KEY "TestTopic key"

// Plain topic
struct TestTopic {
  string key; //@key
  long x;
};

#pragma DCPS_DATA_TYPE "TopicString"
#pragma DCPS_DATA_KEY "TopicString key"

// String
struct TopicString {
  string key; //@key
  string x_str;
};

#pragma DCPS_DATA_TYPE "TopicArray"
#pragma DCPS_DATA_KEY "TopicArray key"

// Arrays
struct TopicArray {
  string key; //@key
  octet_array x_array;
 };

// Unions
union X_Union switch (short) {
    case 0:
      string x_test;
    case 1:
      long   x_long;
};

#pragma DCPS_DATA_TYPE "TopicUnion"
#pragma DCPS_DATA_KEY "TopicUnion key"

struct TopicUnion {
  string key; //@key
  X_Union x_uni;
};

// Sequence
struct test {
  short x_test;
  string x_teststr;
};

typedef sequence<test> testSeq;

#pragma DCPS_DATA_TYPE "TopicSeq"
#pragma DCPS_DATA_KEY "TopicSeq key"

struct TopicSeq {
  string key; //@key
  testSeq x_seq;
};

// ValueType
valuetype X_Valuetype {
  public string type;
  public long x_long;
};

#if !defined (CIAO_DDS4CCM_OPENDDS)
// OpenDDS doesn't support valuetype as topic member
#pragma DCPS_DATA_TYPE "TopicValuetype"
#pragma DCPS_DATA_KEY "TopicValuetype key"

struct TopicValuetype {
  string key; //@key
  X_Valuetype x_vt;
};
#endif

// Sequences
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<TestTopic> TestTopicSeq;
#endif
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<TopicString> TopicStringSeq;
#endif
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<TopicArray> TopicArraySeq;
#endif
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<TopicUnion> TopicUnionSeq;
#endif
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<X_Union> X_UnionSeq;
#endif
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<TopicSeq> TopicSeqSeq;
#endif
#if !defined (CIAO_DDS4CCM_OPENDDS)
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<TopicValuetype> TopicValuetypeSeq;
#endif
#endif
#if defined DDS4CCM_NEEDS_SEQUENCES_DEFINED
typedef sequence<X_Valuetype> X_ValuetypeSeq;
#endif

#endif