Repository navigation
token_pool
Dmitry Koplyarov edited this page Apr 9, 2017
·
6 revisions
A helper class for managing multiple tokens.
Here is the tutorial section.
Defined in wigwag/token_pool.hpp
class token_pool
{
public:
token_pool();
~token_pool();
token_pool& operator += (token&& t);
void add_token(token&& t);
void release();
};token_pool();Constructs an empty token pool.
~token_pool();Releases all tokens, thus releasing the corresponding resources.
void add_token(token&& t);Puts a token object into the pool.
Thread safety: This is a thread-safe method.
Arguments:
- t - the token
void release();Releases all tokens, thus releasing the corresponding resources.
Thread safety: This is a thread-safe method.
token_pool& operator += (token&& t);Puts a token object into the pool.
Thread safety: This is a thread-safe method.
Arguments:
- t - the token
Return value: a reference to the same token_pool object