annotate src/capnproto-git-20161025/c++/samples/addressbook.capnp @ 83:ae30d91d2ffe

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