19 #ifndef avro_Serializer_hh__
20 #define avro_Serializer_hh__
23 #include <boost/noncopyable.hpp>
33 template<
class Writer>
44 writer_.writeValue(
Null());
47 void writeBool(
bool val) {
48 writer_.writeValue(val);
51 void writeInt(int32_t val) {
52 writer_.writeValue(val);
55 void writeLong(int64_t val) {
56 writer_.writeValue(val);
59 void writeFloat(
float val) {
60 writer_.writeValue(val);
63 void writeDouble(
double val) {
64 writer_.writeValue(val);
67 void writeBytes(
const void *val,
size_t size) {
68 writer_.writeBytes(val, size);
72 void writeFixed(
const uint8_t (&val)[N]) {
73 writer_.writeFixed(val);
77 void writeFixed(
const std::array<uint8_t, N> &val) {
78 writer_.writeFixed(val);
81 void writeString(
const std::string &val) {
82 writer_.writeValue(val);
86 writer_.writeRecord();
89 void writeRecordEnd() {
90 writer_.writeRecordEnd();
93 void writeArrayBlock(int64_t size) {
94 writer_.writeArrayBlock(size);
97 void writeArrayEnd() {
98 writer_.writeArrayEnd();
101 void writeMapBlock(int64_t size) {
102 writer_.writeMapBlock(size);
106 writer_.writeMapEnd();
109 void writeUnion(int64_t choice) {
110 writer_.writeUnion(choice);
113 void writeEnum(int64_t choice) {
114 writer_.writeEnum(choice);
117 InputBuffer buffer()
const {
118 return writer_.buffer();