Static Public Member Functions | List of all members
ThreadName Class Reference

A thread-local name. More...

#include <ThreadName.hpp>

Static Public Member Functions

static const std::string & getName ()
 Get the name of the calling thread. More...
 
static void setName (const std::string &name)
 Set the name of the calling thread. More...
 

Detailed Description

A thread-local name.

This implementation is very simple and only allows access to the thread name from the thread itself. It exists mainly to support logging, but may be used for other applications that do not need to access the names of other threads.

It is the responsibility of the end developer to ensure the same name is not used for multiple threads.

Member Function Documentation

◆ getName()

static const std::string& getName ( )
static

Get the name of the calling thread.

◆ setName()

static void setName ( const std::string &  name)
static

Set the name of the calling thread.


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