19 #ifndef avro_Decoder_hh__
20 #define avro_Decoder_hh__
27 #include "ValidSchema.hh"
30 #include <boost/shared_ptr.hpp>
58 virtual void decodeNull() = 0;
61 virtual bool decodeBool() = 0;
64 virtual int32_t decodeInt() = 0;
67 virtual int64_t decodeLong() = 0;
70 virtual float decodeFloat() = 0;
73 virtual double decodeDouble() = 0;
85 virtual void decodeString(std::string& value) = 0;
88 virtual void skipString() = 0;
92 std::vector<uint8_t> result;
99 virtual void decodeBytes(std::vector<uint8_t>& value) = 0;
102 virtual void skipBytes() = 0;
111 std::vector<uint8_t> result;
112 decodeFixed(n, result);
122 virtual void decodeFixed(
size_t n, std::vector<uint8_t>& value) = 0;
125 virtual void skipFixed(
size_t n) = 0;
128 virtual size_t decodeEnum() = 0;
131 virtual size_t arrayStart() = 0;
134 virtual size_t arrayNext() = 0;
140 virtual size_t skipArray() = 0;
143 virtual size_t mapStart() = 0;
146 virtual size_t mapNext() = 0;
152 virtual size_t skipMap() = 0;
155 virtual size_t decodeUnionIndex() = 0;
174 virtual const std::vector<size_t>& fieldOrder() = 0;
191 const DecoderPtr& base);
205 const ValidSchema& reader,
const DecoderPtr& base);
std::vector< uint8_t > decodeBytes()
Decodes arbitray binary data from the current stream.
Definition: Decoder.hh:91
boost::shared_ptr< Decoder > DecoderPtr
Shared pointer to Decoder.
Definition: Decoder.hh:161
A bunch of templates and specializations for encoding and decoding specific types.
Definition: AvroParse.hh:31
AVRO_DECL ResolvingDecoderPtr resolvingDecoder(const ValidSchema &writer, const ValidSchema &reader, const DecoderPtr &base)
Returns a decoder that decodes avro data from base written according to writerSchema and resolves aga...
ResolvingDecoder is derived from Decoder, with an additional function to obtain the field ordering of...
Definition: Decoder.hh:167
AVRO_DECL DecoderPtr validatingDecoder(const ValidSchema &schema, const DecoderPtr &base)
Returns an decoder that validates sequence of calls to an underlying Decoder against the given schema...
boost::shared_ptr< ResolvingDecoder > ResolvingDecoderPtr
Shared pointer to ResolvingDecoder.
Definition: Decoder.hh:180
AVRO_DECL DecoderPtr jsonDecoder(const ValidSchema &schema)
Returns an decoder that can decode Avro standard for JSON.
std::vector< uint8_t > decodeFixed(size_t n)
Decodes fixed length binary from the current stream.
Definition: Decoder.hh:110
A ValidSchema is basically a non-mutable Schema that has passed some minumum of sanity checks...
Definition: ValidSchema.hh:40
AVRO_DECL DecoderPtr binaryDecoder()
Returns an decoder that can decode binary Avro standard.
std::string decodeString()
Decodes a UTF-8 string from the current stream.
Definition: Decoder.hh:76
Decoder is an interface implemented by every decoder capable of decoding Avro data.
Definition: Decoder.hh:49