Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
GenericSchemaDocument< ValueT, Allocator > Class Template Reference

JSON schema document. More...

#include <fwd.h>

Classes

struct  SchemaEntry
 
struct  SchemaRefEntry
 

Public Types

typedef Allocator AllocatorType
 
typedef EncodingType::Ch Ch
 
typedef ValueType::EncodingType EncodingType
 
typedef IGenericRemoteSchemaDocumentProvider< GenericSchemaDocumentIRemoteSchemaDocumentProviderType
 
typedef GenericPointer< ValueType, Allocator > PointerType
 
typedef internal::Schema< GenericSchemaDocumentSchemaType
 
typedef GenericValue< EncodingType, Allocator > URIType
 
typedef ValueT ValueType
 

Public Member Functions

 GenericSchemaDocument (const ValueType &document, const Ch *uri=0, SizeType uriLength=0, IRemoteSchemaDocumentProviderType *remoteProvider=0, Allocator *allocator=0)
 Constructor. More...
 
const SchemaTypeGetRoot () const
 Get the root schema. More...
 
const URITypeGetURI () const
 
 ~GenericSchemaDocument ()
 Destructor. More...
 

Private Member Functions

void CreateSchema (const SchemaType **schema, const PointerType &pointer, const ValueType &v, const ValueType &document)
 
void CreateSchemaRecursive (const SchemaType **schema, const PointerType &pointer, const ValueType &v, const ValueType &document)
 
 GenericSchemaDocument (const GenericSchemaDocument &)
 Prohibit copying. More...
 
PointerType GetPointer (const SchemaType *schema) const
 
const SchemaTypeGetSchema (const PointerType &pointer) const
 
const SchemaTypeGetTypeless () const
 
bool HandleRefSchema (const PointerType &source, const SchemaType **schema, const ValueType &v, const ValueType &document)
 
GenericSchemaDocumentoperator= (const GenericSchemaDocument &)
 Prohibit assignment. More...
 

Private Attributes

Allocator * allocator_
 
Allocator * ownAllocator_
 
IRemoteSchemaDocumentProviderTyperemoteProvider_
 
const SchemaTyperoot_
 Root schema. More...
 
internal::Stack< Allocator > schemaMap_
 
internal::Stack< Allocator > schemaRef_
 
SchemaTypetypeless_
 
URIType uri_
 

Static Private Attributes

static const size_t kInitialSchemaMapSize = 64
 
static const size_t kInitialSchemaRefSize = 64
 

Friends

template<typename , typename , typename >
class GenericSchemaValidator
 
class internal::Schema< GenericSchemaDocument >
 

Detailed Description

template<typename ValueT, typename Allocator = CrtAllocator>
class GenericSchemaDocument< ValueT, Allocator >

JSON schema document.

A JSON schema document is a compiled version of a JSON schema. It is basically a tree of internal::Schema.

Note
This is an immutable class (i.e. its instance cannot be modified after construction).
Template Parameters
ValueTType of JSON value (e.g. Value ), which also determine the encoding.
AllocatorAllocator type for allocating memory of this document.

Definition at line 147 of file fwd.h.

Member Typedef Documentation

template<typename ValueT , typename Allocator = CrtAllocator>
typedef Allocator GenericSchemaDocument< ValueT, Allocator >::AllocatorType

Definition at line 1805 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef EncodingType::Ch GenericSchemaDocument< ValueT, Allocator >::Ch

Definition at line 1807 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef ValueType::EncodingType GenericSchemaDocument< ValueT, Allocator >::EncodingType

Definition at line 1806 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef IGenericRemoteSchemaDocumentProvider<GenericSchemaDocument> GenericSchemaDocument< ValueT, Allocator >::IRemoteSchemaDocumentProviderType

Definition at line 1804 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef GenericPointer<ValueType, Allocator> GenericSchemaDocument< ValueT, Allocator >::PointerType

Definition at line 1809 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef internal::Schema<GenericSchemaDocument> GenericSchemaDocument< ValueT, Allocator >::SchemaType

Definition at line 1808 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef GenericValue<EncodingType, Allocator> GenericSchemaDocument< ValueT, Allocator >::URIType

Definition at line 1810 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
typedef ValueT GenericSchemaDocument< ValueT, Allocator >::ValueType

Definition at line 1803 of file schema.h.

Constructor & Destructor Documentation

template<typename ValueT , typename Allocator = CrtAllocator>
GenericSchemaDocument< ValueT, Allocator >::GenericSchemaDocument ( const ValueType document,
const Ch uri = 0,
SizeType  uriLength = 0,
IRemoteSchemaDocumentProviderType remoteProvider = 0,
Allocator *  allocator = 0 
)
inlineexplicit

Constructor.

Compile a JSON document into schema document.

Parameters
documentA JSON document as source.
uriThe base URI of this schema document for purposes of violation reporting.
uriLengthLength of name, in code points.
remoteProviderAn optional remote schema document provider for resolving remote reference. Can be null.
allocatorAn optional allocator instance for allocating memory. Can be null.

Definition at line 1825 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
GenericSchemaDocument< ValueT, Allocator >::~GenericSchemaDocument ( )
inline

Destructor.

Definition at line 1895 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
GenericSchemaDocument< ValueT, Allocator >::GenericSchemaDocument ( const GenericSchemaDocument< ValueT, Allocator > &  )
private

Prohibit copying.

Member Function Documentation

template<typename ValueT , typename Allocator = CrtAllocator>
void GenericSchemaDocument< ValueT, Allocator >::CreateSchema ( const SchemaType **  schema,
const PointerType pointer,
const ValueType v,
const ValueType document 
)
inlineprivate

Definition at line 1976 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
void GenericSchemaDocument< ValueT, Allocator >::CreateSchemaRecursive ( const SchemaType **  schema,
const PointerType pointer,
const ValueType v,
const ValueType document 
)
inlineprivate

Definition at line 1956 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
PointerType GenericSchemaDocument< ValueT, Allocator >::GetPointer ( const SchemaType schema) const
inlineprivate

Definition at line 2060 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const SchemaType& GenericSchemaDocument< ValueT, Allocator >::GetRoot ( ) const
inline

Get the root schema.

Definition at line 1915 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const SchemaType* GenericSchemaDocument< ValueT, Allocator >::GetSchema ( const PointerType pointer) const
inlineprivate

Definition at line 2051 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const SchemaType* GenericSchemaDocument< ValueT, Allocator >::GetTypeless ( ) const
inlineprivate

Definition at line 2069 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const URIType& GenericSchemaDocument< ValueT, Allocator >::GetURI ( ) const
inline

Definition at line 1909 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
bool GenericSchemaDocument< ValueT, Allocator >::HandleRefSchema ( const PointerType source,
const SchemaType **  schema,
const ValueType v,
const ValueType document 
)
inlineprivate

Definition at line 1992 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
GenericSchemaDocument& GenericSchemaDocument< ValueT, Allocator >::operator= ( const GenericSchemaDocument< ValueT, Allocator > &  )
private

Prohibit assignment.

Friends And Related Function Documentation

template<typename ValueT , typename Allocator = CrtAllocator>
template<typename , typename , typename >
friend class GenericSchemaValidator
friend

Definition at line 1813 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
friend class internal::Schema< GenericSchemaDocument >
friend

Definition at line 1811 of file schema.h.

Member Data Documentation

template<typename ValueT , typename Allocator = CrtAllocator>
Allocator* GenericSchemaDocument< ValueT, Allocator >::allocator_
private

Definition at line 2078 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const size_t GenericSchemaDocument< ValueT, Allocator >::kInitialSchemaMapSize = 64
staticprivate

Definition at line 2074 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const size_t GenericSchemaDocument< ValueT, Allocator >::kInitialSchemaRefSize = 64
staticprivate

Definition at line 2075 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
Allocator* GenericSchemaDocument< ValueT, Allocator >::ownAllocator_
private

Definition at line 2079 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
IRemoteSchemaDocumentProviderType* GenericSchemaDocument< ValueT, Allocator >::remoteProvider_
private

Definition at line 2077 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
const SchemaType* GenericSchemaDocument< ValueT, Allocator >::root_
private

Root schema.

Definition at line 2080 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
internal::Stack<Allocator> GenericSchemaDocument< ValueT, Allocator >::schemaMap_
private

Definition at line 2082 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
internal::Stack<Allocator> GenericSchemaDocument< ValueT, Allocator >::schemaRef_
private

Definition at line 2083 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
SchemaType* GenericSchemaDocument< ValueT, Allocator >::typeless_
private

Definition at line 2081 of file schema.h.

template<typename ValueT , typename Allocator = CrtAllocator>
URIType GenericSchemaDocument< ValueT, Allocator >::uri_
private

Definition at line 2084 of file schema.h.


The documentation for this class was generated from the following files:


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54