Zth (libzth)
zth::UniqueID< T, ThreadSafe > Class Template Reference

Keeps track of a process-wide unique ID within the type T. More...

#include <util.h>

Inheritance diagram for zth::UniqueID< T, ThreadSafe >:
zth::UniqueIDBase

Public Member Functions

 UniqueID (UniqueID const &)=delete
 
UniqueIDoperator= (UniqueID const &)=delete
 
 UniqueID (UniqueID &&u) noexcept
 
UniqueIDoperator= (UniqueID &&u) noexcept
 
 UniqueID (string const &name)
 
 UniqueID (string &&name)
 
 UniqueID (char const *name=nullptr)
 
virtual ~UniqueID ()=default
 
void const * normptr () const noexcept
 
uint64_t id () const noexcept
 
string const & name () const noexcept
 
void setName (string const &name)
 
void setName (char const *name)
 
void setName (string &&name)
 
virtual char const * id_str () const override
 

Static Public Member Functions

static uint64_t getID () noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from zth::UniqueIDBase
virtual ~UniqueIDBase ()=default
 

Detailed Description

template<typename T, bool ThreadSafe = Config::EnableThreads>
class zth::UniqueID< T, ThreadSafe >

Keeps track of a process-wide unique ID within the type T.

Definition at line 657 of file util.h.

Constructor & Destructor Documentation

◆ UniqueID() [1/5]

template<typename T , bool ThreadSafe = Config::EnableThreads>
zth::UniqueID< T, ThreadSafe >::UniqueID ( UniqueID< T, ThreadSafe > const &  )
delete

◆ UniqueID() [2/5]

template<typename T , bool ThreadSafe = Config::EnableThreads>
zth::UniqueID< T, ThreadSafe >::UniqueID ( UniqueID< T, ThreadSafe > &&  u)
inlinenoexcept

Definition at line 665 of file util.h.

◆ UniqueID() [3/5]

template<typename T , bool ThreadSafe = Config::EnableThreads>
zth::UniqueID< T, ThreadSafe >::UniqueID ( string const &  name)
inlineexplicit

Definition at line 694 of file util.h.

◆ UniqueID() [4/5]

template<typename T , bool ThreadSafe = Config::EnableThreads>
zth::UniqueID< T, ThreadSafe >::UniqueID ( string &&  name)
inlineexplicit

Definition at line 700 of file util.h.

◆ UniqueID() [5/5]

template<typename T , bool ThreadSafe = Config::EnableThreads>
zth::UniqueID< T, ThreadSafe >::UniqueID ( char const *  name = nullptr)
inlineexplicit

Definition at line 706 of file util.h.

◆ ~UniqueID()

template<typename T , bool ThreadSafe = Config::EnableThreads>
virtual zth::UniqueID< T, ThreadSafe >::~UniqueID ( )
virtualdefault

Member Function Documentation

◆ getID()

template<typename T , bool ThreadSafe = Config::EnableThreads>
static uint64_t zth::UniqueID< T, ThreadSafe >::getID ( )
inlinestaticnoexcept

Definition at line 683 of file util.h.

◆ id()

template<typename T , bool ThreadSafe = Config::EnableThreads>
uint64_t zth::UniqueID< T, ThreadSafe >::id ( ) const
inlinenoexcept

Definition at line 720 of file util.h.

◆ id_str()

template<typename T , bool ThreadSafe = Config::EnableThreads>
virtual char const* zth::UniqueID< T, ThreadSafe >::id_str ( ) const
inlineoverridevirtual

Implements zth::UniqueIDBase.

Definition at line 751 of file util.h.

◆ name()

template<typename T , bool ThreadSafe = Config::EnableThreads>
string const& zth::UniqueID< T, ThreadSafe >::name ( ) const
inlinenoexcept

Definition at line 725 of file util.h.

◆ normptr()

template<typename T , bool ThreadSafe = Config::EnableThreads>
void const* zth::UniqueID< T, ThreadSafe >::normptr ( ) const
inlinenoexcept

Definition at line 715 of file util.h.

◆ operator=() [1/2]

template<typename T , bool ThreadSafe = Config::EnableThreads>
UniqueID& zth::UniqueID< T, ThreadSafe >::operator= ( UniqueID< T, ThreadSafe > &&  u)
inlinenoexcept

Definition at line 671 of file util.h.

◆ operator=() [2/2]

template<typename T , bool ThreadSafe = Config::EnableThreads>
UniqueID& zth::UniqueID< T, ThreadSafe >::operator= ( UniqueID< T, ThreadSafe > const &  )
delete

◆ setName() [1/3]

template<typename T , bool ThreadSafe = Config::EnableThreads>
void zth::UniqueID< T, ThreadSafe >::setName ( char const *  name)
inline

Definition at line 735 of file util.h.

◆ setName() [2/3]

template<typename T , bool ThreadSafe = Config::EnableThreads>
void zth::UniqueID< T, ThreadSafe >::setName ( string &&  name)
inline

Definition at line 743 of file util.h.

◆ setName() [3/3]

template<typename T , bool ThreadSafe = Config::EnableThreads>
void zth::UniqueID< T, ThreadSafe >::setName ( string const &  name)
inline

Definition at line 730 of file util.h.


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