Skip to content

token_pool

Dmitry Koplyarov edited this page Apr 9, 2017 · 6 revisions

Back to reference

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();
};

Table of contents

Constructors and destructors

default constructor

token_pool();

Constructs an empty token pool.

destructor

~token_pool();

Releases all tokens, thus releasing the corresponding resources.

Methods

add_token

void add_token(token&& t);

Puts a token object into the pool.

Thread safety: This is a thread-safe method.

Arguments:

  • t - the token

release

void release();

Releases all tokens, thus releasing the corresponding resources.

Thread safety: This is a thread-safe method.

Operators

operator +=

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

Clone this wiki locally