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