Lumiera  0.pre.03
»edit your freedom«
TypedCounter Class Reference

#include "lib/typed-counter.hpp"

Description

Utility providing a set of counters, each tied to a specific type.

The actual allocation of id numbers is delegated to TypedContext. Such a counter is used to build symbolic instance IDs with a per-type running counter. Such IDs are used for lib::idi::EntryID and for lib::diff::GenNode.

Warning
the index space for typeIDs is application global; the more distinct types are used, the more slots will be present in each instance of TypedCounter. As of 2023 we are using < 30 distinct types for these use cases, and thus the wasted memory is not much of a concern.

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

Public Member Functions

template<class X >
int64_t dec ()
 
bool empty () const
 
template<class X >
int64_t get () const
 
template<class X >
int64_t inc ()
 
size_t size () const
 

Private Member Functions

template<typename TY >
IxID slot () const
 

Private Attributes

deque< std::atomic_int64_t > counters_
 

Additional Inherited Members

- Static Public Member Functions inherited from Sync<>
static MonitorgetMonitor (Sync const *forThis)
 
+ Inheritance diagram for TypedCounter:
+ Collaboration diagram for TypedCounter:

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