annotate src/capnproto-git-20161025/c++/samples/addressbook.capnp @ 157:570d27da3fb5

Update exclusion list
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 25 Jan 2019 13:49:22 +0000
parents 1ac99bfc383d
children
rev   line source
cannam@133 1 # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
cannam@133 2 # Licensed under the MIT License:
cannam@133 3 #
cannam@133 4 # Permission is hereby granted, free of charge, to any person obtaining a copy
cannam@133 5 # of this software and associated documentation files (the "Software"), to deal
cannam@133 6 # in the Software without restriction, including without limitation the rights
cannam@133 7 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
cannam@133 8 # copies of the Software, and to permit persons to whom the Software is
cannam@133 9 # furnished to do so, subject to the following conditions:
cannam@133 10 #
cannam@133 11 # The above copyright notice and this permission notice shall be included in
cannam@133 12 # all copies or substantial portions of the Software.
cannam@133 13 #
cannam@133 14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
cannam@133 15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cannam@133 16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
cannam@133 17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
cannam@133 18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
cannam@133 19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
cannam@133 20 # THE SOFTWARE.
cannam@133 21
cannam@133 22 @0x9eb32e19f86ee174;
cannam@133 23
cannam@133 24 using Cxx = import "/capnp/c++.capnp";
cannam@133 25 $Cxx.namespace("addressbook");
cannam@133 26
cannam@133 27 struct Person {
cannam@133 28 id @0 :UInt32;
cannam@133 29 name @1 :Text;
cannam@133 30 email @2 :Text;
cannam@133 31 phones @3 :List(PhoneNumber);
cannam@133 32
cannam@133 33 struct PhoneNumber {
cannam@133 34 number @0 :Text;
cannam@133 35 type @1 :Type;
cannam@133 36
cannam@133 37 enum Type {
cannam@133 38 mobile @0;
cannam@133 39 home @1;
cannam@133 40 work @2;
cannam@133 41 }
cannam@133 42 }
cannam@133 43
cannam@133 44 employment :union {
cannam@133 45 unemployed @4 :Void;
cannam@133 46 employer @5 :Text;
cannam@133 47 school @6 :Text;
cannam@133 48 selfEmployed @7 :Void;
cannam@133 49 # We assume that a person is only one of these.
cannam@133 50 }
cannam@133 51 }
cannam@133 52
cannam@133 53 struct AddressBook {
cannam@133 54 people @0 :List(Person);
cannam@133 55 }
cannam@133 56