23 #ifndef HAZELCAST_PortableWriter
24 #define HAZELCAST_PortableWriter
26 #include "hazelcast/client/serialization/pimpl/DefaultPortableWriter.h"
27 #include "hazelcast/client/serialization/pimpl/ClassDefinitionWriter.h"
29 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
31 #pragma warning(disable: 4251) //for dll export
36 namespace serialization {
47 PortableWriter(pimpl::DefaultPortableWriter *defaultPortableWriter);
52 PortableWriter(pimpl::ClassDefinitionWriter *classDefinitionWriter);
59 void writeInt(
const char *fieldName,
int value);
66 void writeLong(
const char *fieldName,
long value);
73 void writeBoolean(
const char *fieldName,
bool value);
80 void writeByte(
const char *fieldName, byte value);
87 void writeChar(
const char *fieldName,
int value);
94 void writeDouble(
const char *fieldName,
double value);
101 void writeFloat(
const char *fieldName,
float value);
108 void writeShort(
const char *fieldName,
short value);
115 void writeUTF(
const char *fieldName,
const std::string *value);
122 void writeByteArray(
const char *fieldName,
const std::vector<byte> *values);
129 void writeCharArray(
const char *fieldName,
const std::vector<char> *values);
136 void writeShortArray(
const char *fieldName,
const std::vector<short> *values);
143 void writeIntArray(
const char *fieldName,
const std::vector<int> *values);
150 void writeLongArray(
const char *fieldName,
const std::vector<long> *values);
157 void writeFloatArray(
const char *fieldName,
const std::vector<float> *values);
164 void writeDoubleArray(
const char *fieldName,
const std::vector<double> *values);
182 return defaultPortableWriter->writeNullPortable<T>(fieldName);
183 return classDefinitionWriter->writeNullPortable<T>(fieldName);
195 return defaultPortableWriter->writePortable(fieldName, portable);
196 return classDefinitionWriter->writePortable(fieldName, portable);
209 return defaultPortableWriter->writePortableArray(fieldName, values);
210 return classDefinitionWriter->writePortableArray(fieldName, values);
224 pimpl::DefaultPortableWriter *defaultPortableWriter;
225 pimpl::ClassDefinitionWriter *classDefinitionWriter;
226 bool isDefaultWriter;
232 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
236 #endif //HAZELCAST_PortableWriter
void writePortableArray(const char *fieldName, const std::vector< T > *values)
Definition: PortableWriter.h:207
void writePortable(const char *fieldName, const T *portable)
Definition: PortableWriter.h:193
Provides serialization methods for primitive types,a arrays of primitive types, Portable, IdentifiedDataSerializable and custom serializables.
Definition: ObjectDataOutput.h:49
void writeNullPortable(const char *fieldName)
To write a null portable value.
Definition: PortableWriter.h:180
Provides a mean of writing portable fields to a binary in form of java primitives arrays of java prim...
Definition: PortableWriter.h:42