Go to the documentation of this file.
19 #ifndef avro_Decoder_hh__
20 #define avro_Decoder_hh__
29 #include "ValidSchema.hh"
57 virtual void decodeNull() = 0;
60 virtual bool decodeBool() = 0;
63 virtual int32_t decodeInt() = 0;
66 virtual int64_t decodeLong() = 0;
69 virtual float decodeFloat() = 0;
72 virtual double decodeDouble() = 0;
84 virtual void decodeString(std::string &value) = 0;
87 virtual void skipString() = 0;
91 std::vector<uint8_t> result;
98 virtual void decodeBytes(std::vector<uint8_t> &value) = 0;
101 virtual void skipBytes() = 0;
110 std::vector<uint8_t> result;
111 decodeFixed(n, result);
121 virtual void decodeFixed(
size_t n, std::vector<uint8_t> &value) = 0;
124 virtual void skipFixed(
size_t n) = 0;
127 virtual size_t decodeEnum() = 0;
130 virtual size_t arrayStart() = 0;
133 virtual size_t arrayNext() = 0;
139 virtual size_t skipArray() = 0;
142 virtual size_t mapStart() = 0;
145 virtual size_t mapNext() = 0;
151 virtual size_t skipMap() = 0;
154 virtual size_t decodeUnionIndex() = 0;
171 virtual void drain() = 0;
190 virtual const std::vector<size_t> &fieldOrder() = 0;
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...
Decoder is an interface implemented by every decoder capable of decoding Avro data.
Definition: Decoder.hh:48
std::shared_ptr< Decoder > DecoderPtr
Shared pointer to Decoder.
Definition: Decoder.hh:177
ResolvingDecoder is derived from Decoder, with an additional function to obtain the field ordering of...
Definition: Decoder.hh:183
std::vector< uint8_t > decodeFixed(size_t n)
Decodes fixed length binary from the current stream.
Definition: Decoder.hh:109
A bunch of templates and specializations for encoding and decoding specific types.
Definition: AvroParse.hh:30
A ValidSchema is basically a non-mutable Schema that has passed some minimum of sanity checks.
Definition: ValidSchema.hh:40
AVRO_DECL DecoderPtr jsonDecoder(const ValidSchema &schema)
Returns an decoder that can decode Avro standard for JSON.
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...
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:75
std::vector< uint8_t > decodeBytes()
Decodes arbitrary binary data from the current stream.
Definition: Decoder.hh:90
std::shared_ptr< ResolvingDecoder > ResolvingDecoderPtr
Shared pointer to ResolvingDecoder.
Definition: Decoder.hh:196