Hazelcast C++ Client
Public Member Functions | List of all members
hazelcast::client::serialization::StreamSerializer Class Referenceabstract

Implement this interface and register to the SerializationConfig. More...

#include <Serializer.h>

+ Inheritance diagram for hazelcast::client::serialization::StreamSerializer:

Public Member Functions

virtual void write (ObjectDataOutput &out, const void *object)=0
 This method writes object to ObjectDataOutput. More...
 
virtual void * read (ObjectDataInput &in)=0
 The factory method to construct the custom objects Override this method if you want to provide a factory for the custom object. More...
 
- Public Member Functions inherited from hazelcast::client::serialization::SerializerBase
virtual int32_t getHazelcastTypeId () const =0
 unique type id for this serializer. More...
 
virtual void destroy ()
 Called when instance is shutting down. More...
 

Detailed Description

Implement this interface and register to the SerializationConfig.

See examples folder for usage examples.

Important note: Except for the global serializer implementation, you need to implement the following free function in same namespace with your class int32_t getHazelcastTypeId(const MyClass*);

which should return same id with its serializer's getHazelcastTypeId() method.

Member Function Documentation

◆ read()

virtual void* hazelcast::client::serialization::StreamSerializer::read ( ObjectDataInput in)
pure virtual

The factory method to construct the custom objects Override this method if you want to provide a factory for the custom object.

The memory should be managed correctly to avoid any leaks.

Parameters
inThe input stream to be read.
Returns
The constructed object.

Implemented in hazelcast::client::serialization::Serializer< T >.

◆ write()

virtual void hazelcast::client::serialization::StreamSerializer::write ( ObjectDataOutput out,
const void *  object 
)
pure virtual

This method writes object to ObjectDataOutput.

Parameters
outObjectDataOutput stream that object will be written to
objectthat will be written to out

Implemented in hazelcast::client::serialization::Serializer< T >.


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