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

ClassDefinition defines a class schema for Portable classes. More...

#include <ClassDefinition.h>

Public Member Functions

 ClassDefinition ()
 Constructor.
 
 ClassDefinition (int factoryId, int classId, int version)
 Constructor. More...
 
void addFieldDef (FieldDefinition &fieldDefinition)
 Internal API. More...
 
bool hasField (char const *fieldName) const
 
const FieldDefinitiongetField (const char *fieldName) const
 
FieldType getFieldType (const char *fieldName) const
 
int getFieldCount () const
 
int getFactoryId () const
 
int getClassId () const
 
int getVersion () const
 
void setVersionIfNotSet (int version)
 Internal API. More...
 
void writeData (pimpl::DataOutput &dataOutput)
 Internal API. More...
 
void readData (pimpl::DataInput &dataInput)
 Internal API. More...
 

Detailed Description

ClassDefinition defines a class schema for Portable classes.

It allows to query field names, types, class id etc. It can be created manually using ClassDefinitionBuilder or on demand during serialization phase.

See also
Portable
ClassDefinitionBuilder

Constructor & Destructor Documentation

hazelcast::client::serialization::ClassDefinition::ClassDefinition ( int  factoryId,
int  classId,
int  version 
)

Constructor.

Parameters
factoryIdfactory id of class
classIdid of class
versionversion of portable class

Member Function Documentation

void hazelcast::client::serialization::ClassDefinition::addFieldDef ( FieldDefinition fieldDefinition)

Internal API.

Parameters
fieldDefinitionto be added
int hazelcast::client::serialization::ClassDefinition::getClassId ( ) const
Returns
class id
int hazelcast::client::serialization::ClassDefinition::getFactoryId ( ) const
Returns
factory id
const FieldDefinition & hazelcast::client::serialization::ClassDefinition::getField ( const char *  fieldName) const
Parameters
fieldNamename of the field
Returns
field definition by given name
Exceptions
IllegalArgumentExceptionwhen field not found
int hazelcast::client::serialization::ClassDefinition::getFieldCount ( ) const
Returns
total field count
FieldType hazelcast::client::serialization::ClassDefinition::getFieldType ( const char *  fieldName) const
Parameters
fieldNamename of the field
Returns
type of given field
Exceptions
IllegalArgumentException
int hazelcast::client::serialization::ClassDefinition::getVersion ( ) const
Returns
version
bool hazelcast::client::serialization::ClassDefinition::hasField ( char const *  fieldName) const
Parameters
fieldNamefield name
Returns
true if this class definition contains a field named by given name
void hazelcast::client::serialization::ClassDefinition::readData ( pimpl::DataInput &  dataInput)

Internal API.

Parameters
dataInput
void hazelcast::client::serialization::ClassDefinition::setVersionIfNotSet ( int  version)

Internal API.

Parameters
versionportable version
void hazelcast::client::serialization::ClassDefinition::writeData ( pimpl::DataOutput &  dataOutput)

Internal API.

Parameters
dataOutput

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