Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Stroika::Foundation::Common::UniqueID< TAG > Class Template Reference

An opaque ID - each New () one never given before, in this process - of a type of its own for each TAG, so one kind cannot be passed for another. UniqueID{} names nothing. More...

#include <UniqueID.h>

Public Member Functions

nonvirtual Characters::String ToString () const
 

Static Public Member Functions

static UniqueID New ()
 One never given before in this process - by New () of any TAG.
 

Detailed Description

template<typename TAG>
class Stroika::Foundation::Common::UniqueID< TAG >

An opaque ID - each New () one never given before, in this process - of a type of its own for each TAG, so one kind cannot be passed for another. UniqueID{} names nothing.

For naming what was added - a callback, a timer, a task - so it can be removed, or asked about, later, without comparing the things themselves (

See also
Execution::CallbackRegistry for why). One made up (UniqueID{}, or another's) names nothing added, so New () need not be guarded.
Example Usage
class Thing {
public:
ID Add (...); // ID id = ID::New (); ...; return id;
void Remove (ID id);
};
An opaque ID - each New () one never given before, in this process - of a type of its own for each TA...
Definition UniqueID.h:50

Definition at line 50 of file UniqueID.h.

Member Function Documentation

◆ ToString()

template<typename TAG >
Characters::String Stroika::Foundation::Common::UniqueID< TAG >::ToString ( ) const
See also
Characters::ToString ()

Definition at line 24 of file UniqueID.inl.


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