blob: 431a0b00660f95a24f66d60d949f46bc2d48e455 [file] [log] [blame]
David Reiss8320a922007-08-14 19:59:26 +00001/*
2../compiler/cpp/thrift -cpp OptionalRequiredTest.thrift
David Reiss2dc72c32007-08-21 23:59:34 +00003g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \
David Reiss8320a922007-08-14 19:59:26 +00004 OptionalRequiredTest.cpp gen-cpp/OptionalRequiredTest_types.cpp \
5 ../lib/cpp/.libs/libthrift.a -o OptionalRequiredTest
6./OptionalRequiredTest
7*/
8
9cpp_namespace thrift.test
10
11struct OldSchool {
12 1: i16 im_int;
13 2: string im_str;
14 3: list<map<i32,string>> im_big;
15}
16
17struct Simple {
18 1: /* :) */ i16 im_default;
19 2: required i16 im_required;
20 3: optional i16 im_optional;
21}
22
23struct Tricky1 {
24 1: /* :) */ i16 im_default;
25}
26
27struct Tricky2 {
28 1: optional i16 im_optional;
29}
30
31struct Tricky3 {
32 1: required i16 im_required;
33}
34
35struct Complex {
36 1: i16 cp_default;
37 2: required i16 cp_required;
38 3: optional i16 cp_optional;
39 4: map<i16,Simple> the_map;
40 5: required Simple req_simp;
41 6: optional Simple opt_simp;
42}
David Reissce161a92007-09-11 22:09:42 +000043
44struct ManyOpt {
45 1: optional i32 opt1;
46 2: optional i32 opt2;
47 3: optional i32 opt3;
48 4: i32 def4;
49 5: optional i32 opt5;
50 6: optional i32 opt6;
51}