Public Member Functions | Protected Member Functions

Avro::Specific::SpecificDefaultReader Class Reference

Reader class for reading data and storing into specific classes. More...

Inheritance diagram for Avro::Specific::SpecificDefaultReader:
Avro::Generic::DefaultReader

List of all members.

Public Member Functions

 SpecificDefaultReader (Schema writerSchema, Schema readerSchema)
 Constructor.

Protected Member Functions

override object ReadRecord (object reuse, RecordSchema writerSchema, Schema readerSchema, Decoder dec)
 Deserializes a record from the stream.
override object ReadFixed (object reuse, FixedSchema writerSchema, Schema readerSchema, Decoder d)
 Deserializes a fixed object and returns the object. The default implementation uses CreateFixed() and GetFixedBuffer() and returns what CreateFixed() returned.
override object ReadEnum (object reuse, EnumSchema writerSchema, Schema readerSchema, Decoder dec)
 Reads an enum from the given decoder.
override object ReadArray (object reuse, ArraySchema writerSchema, Schema readerSchema, Decoder dec)
 Reads an array from the given decoder.
override object ReadMap (object reuse, MapSchema writerSchema, Schema readerSchema, Decoder d)
 Deserialized an avro map. The default implemenation creats a new map using CreateMap() and then adds elements to the map using AddMapEntry().
virtual string getTargetType (Schema schema)
 Gets the target type name in the given schema.

Detailed Description

Reader class for reading data and storing into specific classes.


Constructor & Destructor Documentation

Avro::Specific::SpecificDefaultReader::SpecificDefaultReader ( Schema  writerSchema,
Schema  readerSchema 
) [inline]

Constructor.

Parameters:
writerSchema schema of the object that wrote the data
readerSchema schema of the object that will store the data

Member Function Documentation

virtual string Avro::Specific::SpecificDefaultReader::getTargetType ( Schema  schema  )  [inline, protected, virtual]

Gets the target type name in the given schema.

Parameters:
schema schema containing the type to be determined
nullible used for union schema
Returns:
override object Avro::Specific::SpecificDefaultReader::ReadArray ( object  reuse,
ArraySchema  writerSchema,
Schema  readerSchema,
Decoder  dec 
) [inline, protected, virtual]

Reads an array from the given decoder.

Parameters:
reuse object to store data read
writerSchema schema of the object that wrote the data
readerSchema schema of the object that will store the data
dec decoder object that contains the data to be read
Returns:
array

Reimplemented from Avro::Generic::DefaultReader.

override object Avro::Specific::SpecificDefaultReader::ReadEnum ( object  reuse,
EnumSchema  writerSchema,
Schema  readerSchema,
Decoder  dec 
) [inline, protected, virtual]

Reads an enum from the given decoder.

Parameters:
reuse object to store data read
writerSchema schema of the object that wrote the data
readerSchema schema of the object that will store the data
dec decoder object that contains the data to be read
Returns:
enum value

Reimplemented from Avro::Generic::DefaultReader.

override object Avro::Specific::SpecificDefaultReader::ReadFixed ( object  reuse,
FixedSchema  writerSchema,
Schema  readerSchema,
Decoder  d 
) [inline, protected, virtual]

Deserializes a fixed object and returns the object. The default implementation uses CreateFixed() and GetFixedBuffer() and returns what CreateFixed() returned.

Parameters:
reuse If appropriate, uses this object instead of creating a new one.
writerSchema The FixedSchema the writer used during serialization.
readerSchema The schema that the readr uses. Must be a FixedSchema with the same size as the writerSchema.
d The decoder for deserialization.
Returns:
The deserilized object.

Reimplemented from Avro::Generic::DefaultReader.

override object Avro::Specific::SpecificDefaultReader::ReadMap ( object  reuse,
MapSchema  writerSchema,
Schema  readerSchema,
Decoder  d 
) [inline, protected, virtual]

Deserialized an avro map. The default implemenation creats a new map using CreateMap() and then adds elements to the map using AddMapEntry().

Parameters:
reuse If appropriate, use this instead of creating a new map object.
writerSchema The schema the writer used to write the map.
readerSchema The schema the reader is using.
d The decoder for serialization.
Returns:
The deserialized map object.

Reimplemented from Avro::Generic::DefaultReader.

override object Avro::Specific::SpecificDefaultReader::ReadRecord ( object  reuse,
RecordSchema  writerSchema,
Schema  readerSchema,
Decoder  dec 
) [inline, protected, virtual]

Deserializes a record from the stream.

Parameters:
reuse If not null, a record object that could be reused for returning the result
writerSchema The writer's RecordSchema
readerSchema The reader's schema, must be RecordSchema too.
dec The decoder for deserialization
Returns:
The record object just read

Reimplemented from Avro::Generic::DefaultReader.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties