Hazelcast C++ Client
Public Types | Public Member Functions | Friends | List of all members
hazelcast::client::IdGenerator Class Reference

Cluster-wide unique id generator. More...

#include <IdGenerator.h>

+ Inheritance diagram for hazelcast::client::IdGenerator:

Public Types

enum  { BLOCK_SIZE = 1000 }
 

Public Member Functions

bool init (long id)
 Try to initialize this IdGenerator instance with given id. More...
 
long newId ()
 Generates and returns cluster-wide unique id. More...
 

Friends

class impl::HazelcastClientInstanceImpl
 

Detailed Description

Cluster-wide unique id generator.

Member Function Documentation

◆ init()

bool hazelcast::client::IdGenerator::init ( long  id)

Try to initialize this IdGenerator instance with given id.

Returns
true if initialization success

◆ newId()

long hazelcast::client::IdGenerator::newId ( )

Generates and returns cluster-wide unique id.

Generated ids are guaranteed to be unique for the entire cluster as long as the cluster is live. If the cluster restarts then id generation will start from 0.

Returns
cluster-wide new unique id

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