SFML 2.5.1

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
sf::ThreadLocal Class Reference
System module

Defines variables with thread-local storage. More...

`#include <ThreadLocal.hpp>`

Inheritance diagram for sf::ThreadLocal:

## Public Member Functions

| ThreadLocal (void *value=NULL)
| Default constructor.
| ~ThreadLocal ()
| Destructor.
void | setValue (void *value)
| Set the thread-specific value of the variable.
void * | getValue () const
| Retrieve the thread-specific value of the variable.

## Detailed Description

Defines variables with thread-local storage.

This class manipulates void* parameters and thus is not appropriate for strongly-typed variables.

You should rather use the sf::ThreadLocalPtr template class.

Definition at line 47 of file ThreadLocal.hpp.

## Constructor & Destructor Documentation

## ◆ ThreadLocal()

sf::ThreadLocal::ThreadLocal | ( | void * | value = NULL | ) |

Default constructor.

Parameters

  value | Optional value to initialize the variable

## ◆ ~ThreadLocal()

sf::ThreadLocal::~ThreadLocal | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ getValue()

void * sf::ThreadLocal::getValue | ( |  | ) | const

Retrieve the thread-specific value of the variable.

Returns
  Value of the variable for the current thread

## ◆ setValue()

void sf::ThreadLocal::setValue | ( | void * | value | ) |

Set the thread-specific value of the variable.

Parameters

  value | Value of the variable for the current thread

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

- ThreadLocal.hpp