/usr/include/ncbi-vdb/vdb/schema.hpp is in libncbi-vdb-dev 2.8.1+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | /*===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
*/
#ifndef _hpp_vdb_schema_
#define _hpp_vdb_schema_
#ifndef _h_vdb_schema_
#include <vdb/schema.h>
#endif
/*--------------------------------------------------------------------------
* VSchema
* a virtual table schema
*/
struct VSchema
{
/* AddRef
* Release
* all objects are reference counted
* NULL references are ignored
*/
inline rc_t AddRef () const throw()
{ return VSchemaAddRef ( this ); }
inline rc_t Release () const throw()
{ return VSchemaRelease ( this ); }
/* AddIncludePath
* add an include path to schema for locating input files
*/
inline rc_t AddIncludePath ( const char *path, ... ) throw()
{
va_list args;
va_start ( args, path );
rc_t rc = VSchemaVAddIncludePath ( this, path, args );
va_end ( args );
return rc;
}
inline rc_t AddIncludePath ( const char *path, va_list args ) throw()
{ return VSchemaVAddIncludePath ( this, path, args ); }
/* ParseText
* parse schema text
* add productions to existing schema
*
* "name" [ IN, NULL OKAY ] - optional name
* representing text, e.g. filename
*
* "text" [ IN ] and "bytes" [ IN ] - input buffer of text
*/
inline rc_t ParseText ( const char *name, const char *text, size_t bytes ) throw()
{ return VSchemaParseText ( this, name, text, bytes ); }
/* ParseFile
* parse schema file
* add productions to existing schema
*
* "name" [ IN ] - filename, absolute or valid relative to
* working directory or within an include path
*/
inline rc_t ParseFile ( const char *name, ... ) throw()
{
va_list args;
va_start ( args, name );
rc_t rc = VSchemaVParseFile ( this, name, args );
va_end ( args );
return rc;
}
inline rc_t ParseFile ( const char *name, va_list args ) throw()
{ return VSchemaVParseFile ( this, name, args ); }
/* Dump
* dump schema as text
*
* "mode" [ IN ] - selects textual conversion mode ( see VSchemaDumpMode )
*
* "decl" [ IN, NULL OKAY ] - selects a declaration to dump
*
* "flush" [ IN ] and "dst" [ IN, OPAQUE ] - callback for delivering
* buffered schema text
*/
inline rc_t Dump ( uint32_t mode, const char *decl,
rc_t ( CC * flush ) ( void *dst, const void *buffer, size_t bsize ),
void *dst ) const throw()
{ return VSchemaDump ( this, mode, decl, flush, dst ); }
/* IncludeFiles
* generates a list of paths to include file
*/
inline rc_t IncludeFiles ( struct KNamelist const **list ) const throw()
{ return VSchemaIncludeFiles ( this, list ); }
/* Resolve
* converts a typedecl string to type id and vector dimension
*
* "resolved" [ OUT ] - resolved type declaration
*
* "typedecl" [ IN ] - type declaration
*/
inline rc_t ResolveTypedecl ( VTypedecl *resolved,
const char *typedecl, ... ) const throw()
{
va_list args;
va_start ( args, typedecl );
rc_t rc = VSchemaVResolveTypedecl ( this, resolved, typedecl, args );
va_end ( args );
return rc;
}
inline rc_t ResolveTypedecl ( VTypedecl *resolved,
const char *typedecl, va_list args ) const throw()
{ return VSchemaVResolveTypedecl ( this, resolved, typedecl, args ); }
/* ToText
* convert a VTypedecl into canonical text
*
* "schema" [ IN ] - schema object that would know about this type
*
* "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
* NUL terminated type declaration string
*/
inline bool TypedeclToText ( const VTypedecl *decl, char *buffer,
size_t bsize ) const throw()
{ return VTypedeclToText ( decl, this, buffer, bsize ); }
/* ToSupertype
* attempt to cast a typedecl to a size-equivalent supertype decl
*
* "schema" [ IN ] - schema object that would know about this type
*
* "cast" [ OUT ] - return parameter for supertype decl
* valid only if function returns true.
*
* returns true if cast succeeded
*/
inline bool TypedeclToSupertype ( const VTypedecl *decl,
VTypedecl *cast ) const throw()
{ return VTypedeclToSupertype ( decl, this, cast ); }
/* ToType
* attempt to cast a typedecl to a size-equivalent ancestor decl
*
* "schema" [ IN ] - schema object that would know about this type
*
* "ancestor" [ IN ] - target type or typeset for cast
*
* "cast" [ OUT ] - return parameter for ancestor decl
* valid only if function returns true. if "ancestor" was a typeset,
* the value of "cast" will be the closest matching ancestral type.
*
* "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
* generations. valid only if function returns true. a value of 0 means
* that "self" is a direct match with "ancestor", a value of 1 means that
* "self" is an immediate subtype of "ancestor", etc.
*
* returns true if cast succeeded
*/
inline bool TypedeclToType ( const VTypedecl *decl, uint32_t ancestor,
VTypedecl *cast, uint32_t *distance ) const throw()
{ return VTypedeclToType ( decl, this, ancestor, cast, distance ); }
/* ToTypedecl
* attempt to cast a typedecl to a size-equivalent ancestor decl
*
* "schema" [ IN ] - schema object that would know about this type
*
* "ancestor" [ IN ] - target typedecl or typeset for cast
*
* "cast" [ OUT, NULL OKAY ] - return parameter for ancestor decl
* valid only if function returns true. if "ancestor" was a typeset,
* the value of "cast" will be the closest matching ancestral type.
*
* "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
* generations. valid only if function returns true. a value of 0 means
* that "self" is a direct match with "ancestor", a value of 1 means that
* "self" is an immediate subtype of "ancestor", etc.
*
* returns true if cast succeeded
*/
inline bool TypedeclToTypedecl ( const VTypedecl *decl, const VTypedecl *ancestor,
VTypedecl *cast, uint32_t *distance ) const throw()
{ return VTypedeclToTypedecl ( decl, this, ancestor, cast, distance ); }
/* CommonAncestor
* find a common ancestor between "self" and "peer"
* returns distance as sum of distances from each to "ancestor"
*
* "schema" [ IN ] - schema object that would know about this type
*
* "peer" [ IN ] - typedecl or typeset to compare against self
*
* "ancestor" [ OUT, NULL OKAY ] - return parameter for closest
* common ancestor decl. valid only if function returns true.
*
* "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
* generations. valid only if function returns true. a value of 0 means
* that "self" is a direct match with "peer", a value of 1 means that
* "self" is an immediate subtype of "peer", or vice-versa, etc.
* measured as the sum of distances self=>ancestor and peer=>ancestor
*/
inline bool TypedeclCommonAncestor ( const VTypedecl *decl, const VTypedecl *peer,
VTypedecl *ancestor, uint32_t *distance ) const throw()
{ return VTypedeclCommonAncestor ( decl, this, peer, ancestor, distance ); }
/* DescribeTypedecl
* produce a description of typedecl properties
*/
inline rc_t DescribeTypedecl ( VTypedesc *desc, const VTypedecl *td ) const throw()
{ return VSchemaDescribeTypedecl ( this, desc, td ); }
private:
VSchema ();
~ VSchema ();
VSchema ( const VSchema& );
VSchema &operator = ( const VSchema& );
};
#endif
|