Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. More...
Namespaces | |
namespace | concepts |
The concept classes are used to simplify NodeImpl. | |
Classes | |
struct | is_serializable |
struct | is_promotable |
struct | type_to_avro |
class | CompilerContext |
This class is used to implement an avro spec parser using a flex/bison compiler. More... | |
class | CompilerNode |
This is a generic "untyped" node that may store values for all possible attributes of Avro complex types. More... | |
class | Exception |
Wrapper for std::runtime_error that provides convenience constructor for boost::format objects. More... | |
class | Layout |
class | PrimitiveLayout |
class | CompoundLayout |
class | Node |
Node is the building block for parse trees. More... | |
class | NodeImpl |
Implementation details for Node. More... | |
class | NodePrimitive |
class | NodeSymbolic |
class | NodeRecord |
class | NodeEnum |
class | NodeArray |
class | NodeMap |
class | NodeUnion |
class | NodeFixed |
class | Parser |
Class that wraps a reader or ValidatingReade with an interface that uses explicit get* names instead of getValue. More... | |
class | ReaderImpl |
Parses from an avro encoding to the requested type. More... | |
class | Resolver |
class | ResolverSchema |
class | ResolvingReader |
class | Schema |
The root Schema object is a base class. Nobody constructs this class directly. More... | |
class | NullSchema |
class | BoolSchema |
class | IntSchema |
class | LongSchema |
class | FloatSchema |
class | DoubleSchema |
class | StringSchema |
class | BytesSchema |
class | RecordSchema |
class | EnumSchema |
class | ArraySchema |
class | MapSchema |
class | UnionSchema |
class | FixedSchema |
class | Serializer |
Class that wraps a Writer or ValidatingWriter with an interface that uses explicit write* names instead of writeValue. More... | |
class | SymbolMap |
Avro schemas can include types that were previously defined with names in the same avro schema. More... | |
struct | Null |
define a type to identify Null in template functions More... | |
class | ValidSchema |
A ValidSchema is basically a non-mutable Schema that has passed some minumum of sanity checks. More... | |
class | NullValidator |
class | Validator |
This class is used by both the ValidatingSerializer and ValidationParser objects. More... | |
class | WriterImpl |
Class for writing avro data to a stream. More... | |
class | ostreambuf |
Implementation of streambuf for use by the Buffer's ostream. More... | |
class | istreambuf |
Implementation of streambuf for use by the Buffer's istream. More... | |
class | ostream |
Custom ostream class for writing to an OutputBuffer. More... | |
class | istream |
Custom istream class for reading from an InputBuffer. More... | |
class | OutputBuffer |
The OutputBuffer (write-only buffer). More... | |
class | InputBuffer |
The InputBuffer (read-only buffer). More... | |
class | BufferReader |
Helper class for reading bytes from buffer without worrying about chunk boundaries. More... | |
Typedefs | |
typedef boost::shared_ptr< Node > | NodePtr |
typedef concepts::NoAttribute < std::string > | NoName |
typedef concepts::SingleAttribute < std::string > | HasName |
typedef concepts::NoAttribute < NodePtr > | NoLeaves |
typedef concepts::SingleAttribute < NodePtr > | SingleLeaf |
typedef concepts::MultiAttribute < NodePtr > | MultiLeaves |
typedef concepts::NoAttribute < std::string > | NoLeafNames |
typedef concepts::MultiAttribute < std::string > | LeafNames |
typedef concepts::NoAttribute < int > | NoSize |
typedef concepts::SingleAttribute< int > | HasSize |
typedef NodeImpl< NoName, NoLeaves, NoLeafNames, NoSize > | NodeImplPrimitive |
typedef NodeImpl< HasName, NoLeaves, NoLeafNames, NoSize > | NodeImplSymbolic |
typedef NodeImpl< HasName, MultiLeaves, LeafNames, NoSize > | NodeImplRecord |
typedef NodeImpl< HasName, NoLeaves, LeafNames, NoSize > | NodeImplEnum |
typedef NodeImpl< NoName, SingleLeaf, NoLeafNames, NoSize > | NodeImplArray |
typedef NodeImpl< NoName, MultiLeaves, NoLeafNames, NoSize > | NodeImplMap |
typedef NodeImpl< NoName, MultiLeaves, NoLeafNames, NoSize > | NodeImplUnion |
typedef NodeImpl< HasName, NoLeaves, NoLeafNames, HasSize > | NodeImplFixed |
typedef ReaderImpl< NullValidator > | Reader |
typedef ReaderImpl< Validator > | ValidatingReader |
typedef WriterImpl< NullValidator > | Writer |
typedef WriterImpl< Validator > | ValidatingWriter |
Enumerations | |
enum | SchemaResolution { RESOLVE_NO_MATCH, RESOLVE_MATCH, RESOLVE_PROMOTABLE_TO_LONG, RESOLVE_PROMOTABLE_TO_FLOAT, RESOLVE_PROMOTABLE_TO_DOUBLE } |
enum | Type { AVRO_STRING, AVRO_BYTES, AVRO_INT, AVRO_LONG, AVRO_FLOAT, AVRO_DOUBLE, AVRO_BOOL, AVRO_NULL, AVRO_RECORD, AVRO_ENUM, AVRO_ARRAY, AVRO_MAP, AVRO_UNION, AVRO_FIXED, AVRO_NUM_TYPES, AVRO_SYMBOLIC = AVRO_NUM_TYPES, AVRO_UNKNOWN = -1 } |
Functions | |
template<typename Reader , typename T > | |
void | parse (Reader &p, T &val) |
The main parse entry point function. | |
template<typename T > | |
void | parse (ResolvingReader &p, T &val) |
template<typename Reader , typename T > | |
void | parse (Reader &p, T &val, const boost::false_type &) |
Type trait should be set to is_serializable in otherwise force the compiler to complain. | |
template<typename Reader , typename T > | |
void | translatingParse (Reader &p, T &val, const boost::false_type &) |
template<typename Writer , typename T > | |
void | serialize (Writer &s, const T &val) |
The main serializer entry point function. | |
template<typename Writer , typename T > | |
void | serialize (Writer &s, const T &val, const boost::false_type &) |
Type trait should be set to is_serializable in otherwise force the compiler to complain. | |
void | compileJsonSchema (std::istream &is, ValidSchema &schema) |
Given a stream comtaining a JSON schema, compiles the schema to a ValidSchema object. | |
bool | compileJsonSchema (std::istream &is, ValidSchema &schema, std::string &error) |
Non-throwing version of compileJsonSchema. | |
NodePtr | nodeFromCompilerNode (CompilerNode &compilerNode) |
NodePtr | resolveSymbol (const NodePtr &node) |
Type | nextType (Parser< ValidatingReader > &p) |
bool | currentRecordName (Parser< ValidatingReader > &p, std::string &name) |
bool | nextFieldName (Parser< ValidatingReader > &p, std::string &name) |
Resolver * | constructResolver (const ValidSchema &rwriterSchema, const ValidSchema &readerSchema, const Layout &readerLayout) |
bool | isPrimitive (Type t) |
bool | isCompound (Type t) |
bool | isAvroType (Type t) |
bool | isAvroTypeOrPseudoType (Type t) |
std::ostream & | operator<< (std::ostream &os, avro::Type type) |
std::ostream & | operator<< (std::ostream &os, const Null &null) |
uint64_t | encodeZigzag64 (int64_t input) |
int64_t | decodeZigzag64 (uint64_t input) |
uint32_t | encodeZigzag32 (int32_t input) |
int32_t | decodeZigzag32 (uint32_t input) |
size_t | encodeInt32 (int32_t input, boost::array< uint8_t, 5 > &output) |
size_t | encodeInt64 (int64_t input, boost::array< uint8_t, 10 > &output) |
template<class BufferType > | |
void | toIovec (BufferType &buf, std::vector< struct iovec > &iov) |
Create an array of iovec structures from the buffer. | |
template<typename Reader , typename T > | |
void | parse (Reader &p, T &val, const boost::true_type &) |
The remainder of the file includes default implementations for serializable types. | |
template<typename Reader > | |
void | parse (Reader &p, std::vector< uint8_t > &val, const boost::true_type &) |
template<typename T > | |
void | translatingParse (ResolvingReader &p, T &val, const boost::true_type &) |
template<typename Writer , typename T > | |
void | serialize (Writer &s, T val, const boost::true_type &) |
The remainder of the file includes default implementations for serializable types. | |
template<typename Writer > | |
void | serialize (Writer &s, const std::vector< uint8_t > &val, const boost::true_type &) |
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
bool avro::compileJsonSchema | ( | std::istream & | is, | |
ValidSchema & | schema, | |||
std::string & | error | |||
) |
Non-throwing version of compileJsonSchema.
void avro::compileJsonSchema | ( | std::istream & | is, | |
ValidSchema & | schema | |||
) |
Given a stream comtaining a JSON schema, compiles the schema to a ValidSchema object.
Throws if the schema cannot be compiled to a valid schema
void avro::parse | ( | Reader & | p, | |
T & | val | |||
) | [inline] |
The main parse entry point function.
Takes a parser (either validating or plain) and the object that should receive the parsed data.
void avro::serialize | ( | Writer & | s, | |
const T & | val | |||
) | [inline] |
The main serializer entry point function.
Takes a serializer (either validating or plain) and the object that should be serialized.
void avro::toIovec | ( | BufferType & | buf, | |
std::vector< struct iovec > & | iov | |||
) | [inline] |
Create an array of iovec structures from the buffer.
This utility is used to support writev and readv function calls. The caller should ensure the buffer object is not deleted while using the iovec vector.
If the BufferType is an InputBuffer, the iovec will point to the data that already exists in the buffer, for reading.
If the BufferType is an OutputBuffer, the iovec will point to the free space, which may be written to. Before writing, the caller should call OutputBuffer::reserve() to create enough room for the desired write (which can be verified by calling OutputBuffer::freeSpace()), and after writing, they MUST call OutputBuffer::wroteTo(), otherwise the buffer will not know the space is not free anymore.