annotate win32-mingw/include/capnp/schema-lite.h @ 64:eccd51b72864

Update Win32 capnp builds to v0.6
author Chris Cannam
date Tue, 23 May 2017 09:16:54 +0100
parents 37d53a7e8262
children
rev   line source
Chris@64 1 // Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
Chris@64 2 // Licensed under the MIT License:
Chris@64 3 //
Chris@64 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
Chris@64 5 // of this software and associated documentation files (the "Software"), to deal
Chris@64 6 // in the Software without restriction, including without limitation the rights
Chris@64 7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Chris@64 8 // copies of the Software, and to permit persons to whom the Software is
Chris@64 9 // furnished to do so, subject to the following conditions:
Chris@64 10 //
Chris@64 11 // The above copyright notice and this permission notice shall be included in
Chris@64 12 // all copies or substantial portions of the Software.
Chris@64 13 //
Chris@64 14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Chris@64 15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Chris@64 16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Chris@64 17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Chris@64 18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Chris@64 19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Chris@64 20 // THE SOFTWARE.
Chris@64 21
Chris@64 22 #ifndef CAPNP_SCHEMA_LITE_H_
Chris@64 23 #define CAPNP_SCHEMA_LITE_H_
Chris@64 24
Chris@64 25 #if defined(__GNUC__) && !defined(CAPNP_HEADER_WARNINGS)
Chris@64 26 #pragma GCC system_header
Chris@64 27 #endif
Chris@64 28
Chris@64 29 #include <capnp/schema.capnp.h>
Chris@64 30 #include "message.h"
Chris@64 31
Chris@64 32 namespace capnp {
Chris@64 33
Chris@64 34 template <typename T, typename CapnpPrivate = typename T::_capnpPrivate>
Chris@64 35 inline schema::Node::Reader schemaProto() {
Chris@64 36 // Get the schema::Node for this type's schema. This function works even in lite mode.
Chris@64 37 return readMessageUnchecked<schema::Node>(CapnpPrivate::encodedSchema());
Chris@64 38 }
Chris@64 39
Chris@64 40 template <typename T, uint64_t id = schemas::EnumInfo<T>::typeId>
Chris@64 41 inline schema::Node::Reader schemaProto() {
Chris@64 42 // Get the schema::Node for this type's schema. This function works even in lite mode.
Chris@64 43 return readMessageUnchecked<schema::Node>(schemas::EnumInfo<T>::encodedSchema());
Chris@64 44 }
Chris@64 45
Chris@64 46 } // namespace capnp
Chris@64 47
Chris@64 48 #endif // CAPNP_SCHEMA_LITE_H_