Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
TypedContext< CX > Class Template Reference

#include "lib/typed-counter.hpp"

Description

template<class CX>
class lib::TypedContext< CX >

Provide type-IDs for a specific context.

This facility allows to access a numeric ID for each given distinct type. Type-IDs may be used e.g. for dispatcher tables or for custom allocators. The type-IDs generated here are not completely global though. Rather, they are tied to a specific type context, e.g. a class implementing a custom allocator. These typed contexts are considered to be orthogonal and independent of each other.

Remarks
2023: allocation of global ID counters are protected by double-checked locking with mutex, which is deemed adequate.

Definition at line 86 of file typed-counter.hpp.

Classes

class  ID
 type-ID More...
 

Static Public Member Functions

static IxID newTypeID (IxID &typeID)
 

Static Private Attributes

static IxID lastGeneratedTypeID
 storage for the type-ID generation mechanism
 

Member Function Documentation

◆ newTypeID()

template<class CX >
static IxID newTypeID ( IxID typeID)
inlinestatic

Definition at line 92 of file typed-counter.hpp.

References TypedContext< CX >::lastGeneratedTypeID.

Referenced by TypedContext< CX >::ID< TY >::get().

+ Here is the caller graph for this function:

Member Data Documentation

◆ lastGeneratedTypeID

template<class CX >
IxID lastGeneratedTypeID
staticprivate

storage for the type-ID generation mechanism

Definition at line 88 of file typed-counter.hpp.

Referenced by TypedContext< CX >::newTypeID().

+ Collaboration diagram for TypedContext< CX >:

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