Hazelcast C++ Client
 All Classes Functions Variables Enumerations Pages
Public Member Functions | List of all members
hazelcast::client::serialization::PortableWriter Class Reference

Provides a mean of writing portable fields to a binary in form of java primitives arrays of java primitives , nested portable fields and array of portable fields. More...

#include <PortableWriter.h>

Public Member Functions

 PortableWriter (pimpl::DefaultPortableWriter *defaultPortableWriter)
 Internal api constructor.
 
 PortableWriter (pimpl::ClassDefinitionWriter *classDefinitionWriter)
 Internal api constructor.
 
void writeInt (const char *fieldName, int value)
 
void writeLong (const char *fieldName, long value)
 
void writeBoolean (const char *fieldName, bool value)
 
void writeByte (const char *fieldName, byte value)
 
void writeChar (const char *fieldName, int value)
 
void writeDouble (const char *fieldName, double value)
 
void writeFloat (const char *fieldName, float value)
 
void writeShort (const char *fieldName, short value)
 
void writeUTF (const char *fieldName, const std::string *value)
 
void writeByteArray (const char *fieldName, const std::vector< byte > *values)
 
void writeCharArray (const char *fieldName, const std::vector< char > *values)
 
void writeShortArray (const char *fieldName, const std::vector< short > *values)
 
void writeIntArray (const char *fieldName, const std::vector< int > *values)
 
void writeLongArray (const char *fieldName, const std::vector< long > *values)
 
void writeFloatArray (const char *fieldName, const std::vector< float > *values)
 
void writeDoubleArray (const char *fieldName, const std::vector< double > *values)
 
void end ()
 Internal api , should not be called by end user.
 
template<typename T >
void writeNullPortable (const char *fieldName)
 To write a null portable value. More...
 
template<typename T >
void writePortable (const char *fieldName, const T *portable)
 
template<typename T >
void writePortableArray (const char *fieldName, const std::vector< T > *values)
 
ObjectDataOutputgetRawDataOutput ()
 After writing portable fields, one can write remaining fields in old fashioned way consecutively at the end of stream. More...
 

Detailed Description

Provides a mean of writing portable fields to a binary in form of java primitives arrays of java primitives , nested portable fields and array of portable fields.

Member Function Documentation

ObjectDataOutput & hazelcast::client::serialization::PortableWriter::getRawDataOutput ( )

After writing portable fields, one can write remaining fields in old fashioned way consecutively at the end of stream.

User should not that after getting rawDataOutput trying to write portable fields will result in IOException

Returns
ObjectDataOutput
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeBoolean ( const char *  fieldName,
bool  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeByte ( const char *  fieldName,
byte  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeByteArray ( const char *  fieldName,
const std::vector< byte > *  values 
)
Parameters
fieldNamename of the field
valuesbyte array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeChar ( const char *  fieldName,
int  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeCharArray ( const char *  fieldName,
const std::vector< char > *  values 
)
Parameters
fieldNamename of the field
valueschar array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeDouble ( const char *  fieldName,
double  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeDoubleArray ( const char *  fieldName,
const std::vector< double > *  values 
)
Parameters
fieldNamename of the field
valuesdouble array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeFloat ( const char *  fieldName,
float  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeFloatArray ( const char *  fieldName,
const std::vector< float > *  values 
)
Parameters
fieldNamename of the field
valuesfloat array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeInt ( const char *  fieldName,
int  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeIntArray ( const char *  fieldName,
const std::vector< int > *  values 
)
Parameters
fieldNamename of the field
valuesint array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeLong ( const char *  fieldName,
long  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeLongArray ( const char *  fieldName,
const std::vector< long > *  values 
)
Parameters
fieldNamename of the field
valueslong array to be written
Exceptions
IOException
template<typename T >
void hazelcast::client::serialization::PortableWriter::writeNullPortable ( const char *  fieldName)
inline

To write a null portable value.

Template Parameters
typeof the portable field
Parameters
fieldNamename of the field
Exceptions
IOException
template<typename T >
void hazelcast::client::serialization::PortableWriter::writePortable ( const char *  fieldName,
const T *  portable 
)
inline
Template Parameters
typeof the portable class
Parameters
fieldNamename of the field
portablePortable to be written
Exceptions
IOException
template<typename T >
void hazelcast::client::serialization::PortableWriter::writePortableArray ( const char *  fieldName,
const std::vector< T > *  values 
)
inline
Template Parameters
typeof the portable class
Parameters
fieldNamename of the field
valuesportable array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeShort ( const char *  fieldName,
short  value 
)
Parameters
fieldNamename of the field
valueint value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeShortArray ( const char *  fieldName,
const std::vector< short > *  values 
)
Parameters
fieldNamename of the field
valuesshort array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeUTF ( const char *  fieldName,
const std::string *  value 
)
Parameters
fieldNamename of the field
valueutf string value to be written
Exceptions
IOException

The documentation for this class was generated from the following files: