Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 1 | java_package thrift.test |
| 2 | cpp_namespace thrift.test |
Marc Slemko | 1785985 | 2006-08-15 00:21:31 +0000 | [diff] [blame] | 3 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 4 | enum Numberz |
| 5 | { |
| 6 | ONE = 1, |
| 7 | TWO, |
| 8 | THREE, |
| 9 | FIVE = 5, |
| 10 | SIX, |
| 11 | EIGHT = 8 |
| 12 | } |
| 13 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 14 | typedef i64 UserId |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 15 | |
| 16 | struct Xtruct |
| 17 | { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 18 | 1: string string_thing, |
| 19 | 4: byte byte_thing, |
| 20 | 9: i32 i32_thing, |
| 21 | 11: i64 i64_thing |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | struct Xtruct2 |
| 25 | { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 26 | 1: byte byte_thing, |
| 27 | 2: Xtruct struct_thing, |
| 28 | 3: i32 i32_thing |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | struct Insanity |
| 32 | { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 33 | 1: map<Numberz, UserId> userMap, |
| 34 | 2: list<Xtruct> xtructs |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 35 | } |
| 36 | |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 37 | exception Xception { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 38 | 1: i32 errorCode, |
| 39 | 2: string message |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 40 | } |
| 41 | |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 42 | exception Xception2 { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 43 | 1: i32 errorCode, |
| 44 | 2: Xtruct struct_thing |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 45 | } |
| 46 | |
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame] | 47 | struct EmptyStruct {} |
| 48 | |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 49 | struct OneField { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 50 | 1: EmptyStruct field |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 51 | } |
Marc Slemko | 5b126d6 | 2006-08-11 23:03:42 +0000 | [diff] [blame] | 52 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 53 | service ThriftTest |
| 54 | { |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 55 | void testVoid(), |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 56 | string testString(1: string thing), |
| 57 | byte testByte(1: byte thing), |
| 58 | i32 testI32(1: i32 thing), |
| 59 | i64 testI64(1: i64 thing), |
| 60 | double testDouble(1: double thing), |
| 61 | Xtruct testStruct(1: Xtruct thing), |
| 62 | Xtruct2 testNest(1: Xtruct2 thing), |
| 63 | map<i32,i32> testMap(1: map<i32,i32> thing), |
| 64 | set<i32> testSet(1: set<i32> thing), |
| 65 | list<i32> testList(1: list<i32> thing), |
| 66 | Numberz testEnum(1: Numberz thing), |
| 67 | UserId testTypedef(1: UserId thing), |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 68 | |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 69 | map<i32,map<i32,i32>> testMapMap(1: i32 hello), |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 70 | |
| 71 | /* So you think you've got this all worked, out eh? */ |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 72 | map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument), |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 73 | |
| 74 | /* Multiple parameters */ |
Marc Slemko | 0b4ffa9 | 2006-08-11 02:49:29 +0000 | [diff] [blame] | 75 | |
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame] | 76 | Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5), |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 77 | |
| 78 | /* Exception specifier */ |
| 79 | |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 80 | void testException(string arg) throws(Xception err1), |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 81 | |
| 82 | /* Multiple exceptions specifier */ |
| 83 | |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 84 | Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2) |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 85 | } |
Mark Slee | dafa3cf | 2006-09-02 23:56:49 +0000 | [diff] [blame] | 86 | |
| 87 | service SecondService |
| 88 | { |
| 89 | void blahBlah() |
| 90 | } |