Chris@50: // Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors Chris@50: // Licensed under the MIT License: Chris@50: // Chris@50: // Permission is hereby granted, free of charge, to any person obtaining a copy Chris@50: // of this software and associated documentation files (the "Software"), to deal Chris@50: // in the Software without restriction, including without limitation the rights Chris@50: // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell Chris@50: // copies of the Software, and to permit persons to whom the Software is Chris@50: // furnished to do so, subject to the following conditions: Chris@50: // Chris@50: // The above copyright notice and this permission notice shall be included in Chris@50: // all copies or substantial portions of the Software. Chris@50: // Chris@50: // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR Chris@50: // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, Chris@50: // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE Chris@50: // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER Chris@50: // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, Chris@50: // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN Chris@50: // THE SOFTWARE. Chris@50: Chris@50: #ifndef CAPNP_SCHEMA_LITE_H_ Chris@50: #define CAPNP_SCHEMA_LITE_H_ Chris@50: Chris@50: #if defined(__GNUC__) && !defined(CAPNP_HEADER_WARNINGS) Chris@50: #pragma GCC system_header Chris@50: #endif Chris@50: Chris@50: #include Chris@50: #include "message.h" Chris@50: Chris@50: namespace capnp { Chris@50: Chris@50: template Chris@50: inline schema::Node::Reader schemaProto() { Chris@50: // Get the schema::Node for this type's schema. This function works even in lite mode. Chris@50: return readMessageUnchecked(CapnpPrivate::encodedSchema()); Chris@50: } Chris@50: Chris@50: template ::typeId> Chris@50: inline schema::Node::Reader schemaProto() { Chris@50: // Get the schema::Node for this type's schema. This function works even in lite mode. Chris@50: return readMessageUnchecked(schemas::EnumInfo::encodedSchema()); Chris@50: } Chris@50: Chris@50: } // namespace capnp Chris@50: Chris@50: #endif // CAPNP_SCHEMA_LITE_H_