2006-05-30 09:24:40 +00:00
|
|
|
enum Numberz
|
|
|
|
{
|
|
|
|
ONE = 1,
|
|
|
|
TWO,
|
|
|
|
THREE,
|
|
|
|
FIVE = 5,
|
|
|
|
SIX,
|
|
|
|
EIGHT = 8
|
|
|
|
}
|
|
|
|
|
2006-06-30 18:28:50 +00:00
|
|
|
typedef i64 UserId
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
struct Xtruct
|
|
|
|
{
|
|
|
|
string string_thing = 0,
|
|
|
|
byte byte_thing = 1,
|
|
|
|
i32 i32_thing = 3,
|
|
|
|
i64 i64_thing = 5
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Xtruct2
|
|
|
|
{
|
2006-08-11 02:49:29 +00:00
|
|
|
byte byte_thing,
|
|
|
|
Xtruct struct_thing,
|
|
|
|
i32 i32_thing
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Insanity
|
|
|
|
{
|
|
|
|
map<Numberz, UserId> userMap = 0,
|
2006-08-12 00:32:53 +00:00
|
|
|
list<Xtruct> xtructs = 1
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|
|
|
|
|
2006-08-14 23:30:37 +00:00
|
|
|
exception Exception {
|
|
|
|
u32 errorCode,
|
|
|
|
string message
|
|
|
|
}
|
|
|
|
|
|
|
|
exception Xception {
|
|
|
|
u32 errorCode,
|
|
|
|
Xtruct struct_thing
|
|
|
|
}
|
|
|
|
|
2006-08-11 23:03:42 +00:00
|
|
|
struct Empty {}
|
2006-08-14 23:30:37 +00:00
|
|
|
struct OneField {
|
|
|
|
Empty field
|
|
|
|
}
|
2006-08-11 23:03:42 +00:00
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
service ThriftTest
|
|
|
|
{
|
2006-08-14 23:30:37 +00:00
|
|
|
void testVoid(),
|
|
|
|
string testString(string thing = 0),
|
|
|
|
byte testByte(byte thing = 0),
|
|
|
|
i32 testI32(i32 thing = 0),
|
|
|
|
i64 testI64(i64 thing = 0),
|
|
|
|
Xtruct testStruct(Xtruct thing = 0),
|
|
|
|
Xtruct2 testNest(Xtruct2 thing = 0),
|
|
|
|
map<i32,i32> testMap(map<i32,i32> thing = 0),
|
|
|
|
set<i32> testSet(set<i32> thing = 0),
|
|
|
|
list<i32> testList(list<i32> thing = 0),
|
|
|
|
Numberz testEnum(Numberz thing = 0),
|
|
|
|
UserId testTypedef(UserId thing = 0),
|
|
|
|
|
|
|
|
map<i32,map<i32,i32>> testMapMap(i32 hello = 0),
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
/* So you think you've got this all worked, out eh? */
|
2006-08-14 23:30:37 +00:00
|
|
|
map<UserId, map<Numberz,Insanity>> testInsanity(Insanity argument = 0),
|
|
|
|
|
|
|
|
/* Multiple parameters */
|
2006-08-11 02:49:29 +00:00
|
|
|
|
2006-08-14 23:30:37 +00:00
|
|
|
Xtruct testMulti(byte arg0, i32 arg1, u64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
|
|
|
|
|
|
|
|
/* Exception specifier */
|
|
|
|
|
|
|
|
Xtruct testException(string arg) throws(Exception err1),
|
|
|
|
|
|
|
|
/* Multiple exceptions specifier */
|
|
|
|
|
|
|
|
Xtruct testMultiException(string arg0, string arg1) throws(Exception err1=1, Xception err2)
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|