blob: 7d971e60fa3f3e415797683bc94edd44ac0dc4ae [file] [log] [blame]
David Reissea2cba82009-03-30 21:35:00 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
David Reiss9a08dc62008-02-27 01:55:17 +000020namespace cpp yozone
Mark Sleea4713ea2007-01-05 01:09:04 +000021
22struct thing {
23 1: i32 hello,
24 2: i32 goodbye
25}
26
David Reiss176ed362008-06-10 22:56:48 +000027enum enumconstants {
Mark Sleed0767c52007-07-27 22:14:41 +000028 ONE = 1,
29 TWO = 2
30}
31
Anthony F. Molinaro71a58a82010-09-27 19:27:40 +000032// struct thing2 {
33// /** standard docstring */
34// 1: enumconstants val = TWO
35// }
David Reiss202111d2007-08-06 20:38:18 +000036
David Reiss9a4edfa2008-05-01 05:52:50 +000037typedef i32 myIntType
38const myIntType myInt = 3
39
Anthony F. Molinaro71a58a82010-09-27 19:27:40 +000040//const map<enumconstants,string> GEN_ENUM_NAMES = {ONE : "HOWDY", TWO: "PARTNER"}
Mark Sleed0767c52007-07-27 22:14:41 +000041
Mark Sleea4713ea2007-01-05 01:09:04 +000042const i32 hex_const = 0x0001F
43
44const i32 GEN_ME = -3523553
45const double GEn_DUB = 325.532
46const double GEn_DU = 085.2355
47const string GEN_STRING = "asldkjasfd"
48
49const map<i32,i32> GEN_MAP = { 35532 : 233, 43523 : 853 }
50const list<i32> GEN_LIST = [ 235235, 23598352, 3253523 ]
51
52const map<i32, map<i32, i32>> GEN_MAPMAP = { 235 : { 532 : 53255, 235:235}}
53
54const map<string,i32> GEN_MAP2 = { "hello" : 233, "lkj98d" : 853, 'lkjsdf' : 098325 }
55
56const thing GEN_THING = { 'hello' : 325, 'goodbye' : 325352 }
57
58const map<i32,thing> GEN_WHAT = { 35 : { 'hello' : 325, 'goodbye' : 325352 } }
59
60const set<i32> GEN_SET = [ 235, 235, 53235 ]
61
62exception Blah {
63 1: i32 bing }
64
65exception Gak {}
66
67service yowza {
68 void blingity(),
69 i32 blangity() throws (1: Blah hoot )
70}