HiĀ  Purush,
Thank you for taking this up. I think we can do this provided, it does not 
break code written against current Avro. In particular we need to to ensure 
that it is "source compatible" (meaning existing client code should continue to 
work) and "compiler version compatible" (meaning it should compile against 
C++11 or later).
Please go ahead and submit your pull request, we'll review and come back.
Thank you,
Thiru


    On Friday, 13 December, 2019, 06:39:48 am IST, Purushotham Nayak 
<purushotham.m.na...@gmail.com> wrote:  
 
 Hi Everyone,

There are a few changes I wanted to make to the C++ implementation and make
compatible with std (and asio) streams as well as update it to use
C++11/14. I wanted to see what other thought. I would be happy to make the
change. I already have an implementation along these lines.

Currently, we use the output stream like this:

std::auto_ptr<avro::OutputStream> out =
avro::fileOutputStream("complex.dat", 4096);
avro::EncoderPtr e = avro::binaryEncoder();
e->init(*out);
c::cpx c1;
c1.re = 1.0;
c1.im = 2.13;
avro::encode(*e, c1);

Instead we should able to do like this:

avro::ostream os("complex.dat", ios_base::binary); // avro binary stream
c::cpx c1;
c1.re = 1.0;
c1.im = 2.13;
os << c1;

In other words, it should work similar to std stream. The use of
ios_base::binary or not decides whether this is a binary / json stream. The
implementation of the encoder/buffer is internal to the stream and client
classes don't need to be aware of them.

- Purush
  

Reply via email to