blob: 9738bd6aac4e8fb81a6bdd8b6c10eada87d6472e [file] [log] [blame]
David Reiss8320a922007-08-14 19:59:26 +00001/*
2../compiler/cpp/thrift -cpp OptionalRequiredTest.thrift
3g++ -Wall -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \
4 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}