Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator 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, int32_t value)
 
void writeLong (const char *fieldName, int64_t value)
 
void writeBoolean (const char *fieldName, bool value)
 
void writeByte (const char *fieldName, byte value)
 
void writeChar (const char *fieldName, int32_t value)
 
void writeDouble (const char *fieldName, double value)
 
void writeFloat (const char *fieldName, float value)
 
void writeShort (const char *fieldName, int16_t value)
 
void writeUTF (const char *fieldName, const std::string *value)
 
void writeByteArray (const char *fieldName, const std::vector< byte > *values)
 
void writeBooleanArray (const char *fieldName, const std::vector< bool > *values)
 
void writeCharArray (const char *fieldName, const std::vector< char > *values)
 
void writeShortArray (const char *fieldName, const std::vector< int16_t > *values)
 
void writeIntArray (const char *fieldName, const std::vector< int32_t > *values)
 
void writeLongArray (const char *fieldName, const std::vector< int64_t > *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
valueboolean value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeBooleanArray ( const char *  fieldName,
const std::vector< bool > *  values 
)
Parameters
fieldNamename of the field
valuesbool array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeByte ( const char *  fieldName,
byte  value 
)
Parameters
fieldNamename of the field
valuebyte 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,
int32_t  value 
)
Parameters
fieldNamename of the field
valuechar 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
valuedouble 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
valuefloat 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,
int32_t  value 
)
Parameters
fieldNamename of the field
valueint32_t value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeIntArray ( const char *  fieldName,
const std::vector< int32_t > *  values 
)
Parameters
fieldNamename of the field
valuesint32_t array to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeLong ( const char *  fieldName,
int64_t  value 
)
Parameters
fieldNamename of the field
valueint64_t value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeLongArray ( const char *  fieldName,
const std::vector< int64_t > *  values 
)
Parameters
fieldNamename of the field
valuesint64_t 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,
int16_t  value 
)
Parameters
fieldNamename of the field
valueint16_t value to be written
Exceptions
IOException
void hazelcast::client::serialization::PortableWriter::writeShortArray ( const char *  fieldName,
const std::vector< int16_t > *  values 
)
Parameters
fieldNamename of the field
valuesint16_t 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: