37 template<
class T,
class... Args >
38 std::unique_ptr<T> make_unique( Args&&... args ){
39 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
46 IDAssigner(
const ID& start = 0) : max_id(start){}
48 if(reusable_ids.empty()){
51 ID
id = reusable_ids.back();
52 reusable_ids.pop_back();
56 void release(
const ID&
id){
57 reusable_ids.push_back(
id);
58 std::sort(reusable_ids.begin(), reusable_ids.end(), std::greater<ID>());
61 std::vector<ID> reusable_ids;
81 virtual uint8_t*
toRGBATexture(uint32_t (&tex)[64*64])
const = 0;
91 static const size_t val
94 : (N < 4294967296U) ? 4
100 template<
int N>
struct size2type {};
101 template<>
struct size2type<1> {
typedef uint8_t type;};
102 template<>
struct size2type<2> {
typedef uint16_t type;};
103 template<>
struct size2type<4> {
typedef uint32_t type;};
104 template<>
struct size2type<8> {
typedef uint64_t type;};
virtual size_t getNumSnapshotStats() const =0
Get the number of available snapshot statistics.
Client statistics interface.
Definition: nrg_util.h:66
Definition: nrg_util.h:44
virtual uint8_t * toRGBATexture(uint32_t(&tex)[64 *64]) const =0
Create a Lagometer texture from the stats.
virtual size_t getNumInterpStats() const =0
Get the number of available interpolation statistics.
virtual int getSnapshotStat(size_t index) const =0
Get a snapshot statistic which shows the latency at which snapshots were received, -1 means it was dropped.
Common defines and includes used by all the other nrg header files.
virtual float getInterpStat(size_t index) const =0
Get a statistic showing how far between snapshots the client is interpolating, >1 means it is having ...