50#ifndef LIB_TYPED_COUNTER_H
51#define LIB_TYPED_COUNTER_H
62 std::string
showSize (
size_t)
noexcept;
101 template<
typename TY>
124 template<
typename TY>
144 template<
typename TY>
166 return counters_[slot<X>()].load(std::memory_order_relaxed);
173 return 1 +
counters_[slot<X>()].fetch_add(+1, std::memory_order_relaxed);
180 return -1 +
counters_[slot<X>()].fetch_add(-1, std::memory_order_relaxed);
202 template<
typename TY>
214 return memberCounter.fetch_add(+1, std::memory_order_relaxed);
222 operator size_t()
const
227 operator string()
const
235 return prefix+string(
id);
241 return string(prefix)+id;
246 template<
typename TY>
A synchronisation protection guard employing a lock scoped to the parameter type as a whole,...
Utility to produce member IDs for objects belonging to a "Family", as defined by a distinguishing typ...
friend string operator+(string const &prefix, FamilyMember id)
static size_t allocateNextMember()
threadsafe allocation of member ID
static std::atomic_size_t memberCounter
member counter shared per template instance
scoped guard to control the actual locking.
Facility for monitor object based locking.
static IxID typeID
table holding all the generated type-IDs
Provide type-IDs for a specific context.
static IxID newTypeID(IxID &typeID)
static IxID lastGeneratedTypeID
storage for the type-ID generation mechanism
Utility providing a set of counters, each tied to a specific type.
deque< std::atomic_int64_t > counters_
Lumiera error handling (C++ interface).
Implementation namespace for support and library code.
string showSize(size_t val) noexcept
A special implementation of lib::Sync, where the storage of the object monitor is associated directly...