R-Type 0.1
Loading...
Searching...
No Matches
rtype::server::NetworkIdGenerator Class Reference

Process wide source of unique network entity ids, starting at 1000. More...

#include <NetworkIdGenerator.hpp>

Public Member Functions

 NetworkIdGenerator (const NetworkIdGenerator &)=delete
 
NetworkIdGenerator & operator= (const NetworkIdGenerator &)=delete
 
std::uint32_t getNextId ()
 Returns a new id, thread safe.
 

Static Public Member Functions

static NetworkIdGenerator & getInstance ()
 Returns the single generator instance.
 

Detailed Description

Process wide source of unique network entity ids, starting at 1000.

Member Function Documentation

◆ getInstance()

static NetworkIdGenerator & rtype::server::NetworkIdGenerator::getInstance ( )
inlinestatic

Returns the single generator instance.

Returns
The shared generator.

◆ getNextId()

std::uint32_t rtype::server::NetworkIdGenerator::getNextId ( )
inline

Returns a new id, thread safe.

Returns
An id never returned before.