Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
shambase::WithUUID< T, Tint, thread_safe > Class Template Reference

A class that provides unique identifiers (UUID) to instances. More...

#include <shambase/include/shambase/WithUUID.hpp>

Public Member Functions

Tint get_uuid () const
 Get the uuid of the class.
 
 WithUUID ()
 Constructor of the class.
 

Protected Attributes

Tint uuid
 The unique identifier of the class.
 

Detailed Description

template<typename T, class Tint, bool thread_safe = true>
class shambase::WithUUID< T, Tint, thread_safe >

A class that provides unique identifiers (UUID) to instances.

Template Parameters
TThe class type to which the UUID will be assigned
TintThe data type for the UUID
thread_safeWhether the UUID constructor should be thread-safe

Example usage:

class A1 : public WithUUID<A1, u64> {};
...
std::cout << "Instance1 UUID: " << A1{}.get_uuid() << std::endl;
A class that provides unique identifiers (UUID) to instances.
Definition WithUUID.hpp:37
Tint get_uuid() const
Get the uuid of the class.
Definition WithUUID.hpp:51
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.

Definition at line 37 of file WithUUID.hpp.

Constructor & Destructor Documentation

◆ WithUUID()

template<typename T , class Tint , bool thread_safe = true>
shambase::WithUUID< T, Tint, thread_safe >::WithUUID ( )
inline

Constructor of the class.

Assigns a unique identifier to the class

Definition at line 58 of file WithUUID.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ get_uuid()

template<typename T , class Tint , bool thread_safe = true>
Tint shambase::WithUUID< T, Tint, thread_safe >::get_uuid ( ) const
inline

Get the uuid of the class.

Returns
The uuid of the class

Definition at line 51 of file WithUUID.hpp.

Member Data Documentation

◆ uuid

template<typename T , class Tint , bool thread_safe = true>
Tint shambase::WithUUID< T, Tint, thread_safe >::uuid
protected

The unique identifier of the class.

Definition at line 43 of file WithUUID.hpp.


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