David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | thrift -cpp DebugProtoTest.thrift |
David Reiss | 2dc72c3 | 2007-08-21 23:59:34 +0000 | [diff] [blame] | 3 | g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ |
David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 4 | DebugProtoTest.cpp gen-cpp/DebugProtoTest_types.cpp \ |
| 5 | ../lib/cpp/.libs/libthrift.a -o DebugProtoTest |
| 6 | ./DebugProtoTest |
| 7 | */ |
| 8 | |
| 9 | cpp_namespace thrift.test |
| 10 | |
| 11 | struct OneOfEach { |
| 12 | 1: bool im_true, |
| 13 | 2: bool im_false, |
| 14 | 3: byte a_bite, |
| 15 | 4: i16 integer16, |
| 16 | 5: i32 integer32, |
| 17 | 6: i64 integer64, |
| 18 | 7: double double_precision, |
| 19 | 8: string some_characters, |
| 20 | 9: string zomg_unicode, |
| 21 | 10: bool what_who, |
| 22 | } |
| 23 | |
| 24 | struct Bonk { |
| 25 | 1: i32 type, |
| 26 | 2: string message, |
| 27 | } |
| 28 | |
| 29 | struct Nesting { |
| 30 | 1: Bonk my_bonk, |
| 31 | 2: OneOfEach my_ooe, |
| 32 | } |
| 33 | |
| 34 | struct HolyMoley { |
| 35 | 1: list<OneOfEach> big, |
| 36 | 2: set<list<string>> contain, |
| 37 | 3: map<string,list<Bonk>> bonks, |
| 38 | } |
David Reiss | 382fc30 | 2007-08-25 18:01:30 +0000 | [diff] [blame] | 39 | |
| 40 | struct Backwards { |
| 41 | 2: i32 first_tag2, |
| 42 | 1: i32 second_tag1, |
| 43 | } |
| 44 | |
| 45 | struct Empty { |
| 46 | } |
| 47 | |
| 48 | struct Wrapper { |
| 49 | 1: Empty foo |
| 50 | } |
| 51 | |
| 52 | struct RandomStuff { |
| 53 | 1: i32 a, |
| 54 | 2: i32 b, |
| 55 | 3: i32 c, |
| 56 | 4: i32 d, |
| 57 | 5: list<i32> myintlist, |
| 58 | 6: map<i32,Wrapper> maps, |
| 59 | 7: i64 bigint, |
| 60 | 8: double triple, |
| 61 | } |
| 62 | |
| 63 | service Srv { |
| 64 | i32 Janky(i32 arg) |
| 65 | } |
David Reiss | 2375312 | 2007-08-27 19:57:34 +0000 | [diff] [blame] | 66 | |
| 67 | service PartiallyReflectable { |
| 68 | map<i32,map<i32,i32>> returnNotReflectable(1: i32 hello), |
| 69 | void argNotReflectable(1: list<set<i32>> arg), |
| 70 | void arg2NotReflectable(1: i32 arg1, 2: list<set<i32>> argNotReflectable), |
| 71 | void withMap(1: map<i32, string> amap), |
| 72 | |
| 73 | OneOfEach refl1(1: list<Bonk> arg1), |
| 74 | OneOfEach refl2(2: list<string> arg1, 1: Bonk arg2); |
| 75 | } |
David Reiss | faebedd | 2007-09-17 23:20:38 +0000 | [diff] [blame] | 76 | |
| 77 | // The only purpose of this thing is to increase the size of the generated code |
| 78 | // so that ZlibTest has more highly compressible data to play with. |
| 79 | struct BlowUp { |
| 80 | 1: map<list<i32>,set<map<i32,string>>> b1; |
| 81 | 2: map<list<i32>,set<map<i32,string>>> b2; |
| 82 | 3: map<list<i32>,set<map<i32,string>>> b3; |
| 83 | 4: map<list<i32>,set<map<i32,string>>> b4; |
| 84 | } |