Documentation of SFML 2.4.2

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
sf::ThreadLocal Class Reference

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

#include <ThreadLocal.hpp>

Inheritance diagram for sf::ThreadLocal:
sf::NonCopyable sf::ThreadLocalPtr< T >

Public Member Functions

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

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

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

Default constructor.

Parameters
valueOptional value to initialize the variable
sf::ThreadLocal::~ThreadLocal ( )

Destructor.

Member Function Documentation

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

Retrieve the thread-specific value of the variable.

Returns
Value of the variable for the current thread
void sf::ThreadLocal::setValue ( void *  value)

Set the thread-specific value of the variable.

Parameters
valueValue of the variable for the current thread

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