Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
IDGenerator.h
Go to the documentation of this file.
1#pragma once
2
3#include <Utility/IUninstantiable.h>
4#include <Common/primitive_type.h>
5
6#include <string>
7
8namespace ph::editor
9{
10
11class IDGenerator : private IUninstantiable
12{
13public:
19 static uint64 nextCount();
20
30 static uint64 nextTimestampedCount();
31
37 static uint64 nextRandomNumber();
38
39 static std::string toString(uint64 id, int base = 16);
40 static std::string toString(uint64 id1, uint64 id2, int base = 16);
41};
42
43}// end namespace ph::editor
Definition IDGenerator.h:12
static uint64 nextCount()
A global number that increases on each call. The best option for usages that require unique ID within...
Definition IDGenerator.cpp:26
static uint64 nextRandomNumber()
A random number that can be part of a wider ID format. The generated number can duplicate though the ...
Definition IDGenerator.cpp:36
static std::string toString(uint64 id, int base=16)
Definition IDGenerator.cpp:42
static uint64 nextTimestampedCount()
Similar to nextCount(), with a time point associated to it. This variant offers better chance that th...
Definition IDGenerator.cpp:31
Definition ph_editor.h:10