Lumiera  0.pre.03
»edit your freedom«
FamilyMember< TY > Class Template Reference

#include "lib/typed-counter.hpp"

Description

template<typename TY>
class lib::FamilyMember< TY >

Utility to produce member IDs for objects belonging to a "Family", as defined by a distinguishing type.

Within each family, each new instance of FamilyMember holds a new distinct id number.

Remarks
this builds a structure similar to TypedContext, however the second level is not assigned per type but rather per instance of FamilyMember<TY>

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

Public Member Functions

 operator size_t () const
 
 operator string () const
 

Friends

string operator+ (string const &prefix, FamilyMember id)
 
string operator+ (const char *prefix, FamilyMember id)
 

Static Private Member Functions

static size_t allocateNextMember ()
 threadsafe allocation of member ID
 

Private Attributes

const size_t id_
 

Static Private Attributes

static std::atomic_size_t memberCounter {0}
 member counter shared per template instance More...
 

Member Data Documentation

◆ memberCounter

std::atomic_size_t memberCounter {0}
staticprivate

member counter shared per template instance

allocate storage for the counter per type family

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

+ Collaboration diagram for FamilyMember< TY >:

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