STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
Concurrency::details::_CancellationTokenState::TokenRegistrationContainer Class Reference

#include <pplcancellation_token.h>

Classes

struct  _Node
 

Public Member Functions

 TokenRegistrationContainer ()
 
 ~TokenRegistrationContainer ()
 
void swap (TokenRegistrationContainer &_List)
 
bool empty ()
 
template<typename _Ty >
void for_each (_Ty _Lambda)
 
void push_back (_CancellationTokenRegistration *_Token)
 
void remove (_CancellationTokenRegistration *_Token)
 

Private Types

typedef struct Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_Node Node
 

Private Attributes

Node_M_begin
 
Node_M_last
 

Member Typedef Documentation

Constructor & Destructor Documentation

Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::TokenRegistrationContainer ( )
inline
237  : _M_begin(nullptr), _M_last(nullptr)
238  {
239  }
Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::~TokenRegistrationContainer ( )
inline
242  {
243  auto _Node = _M_begin;
244  while (_Node != nullptr)
245  {
246  Node* _Tmp = _Node;
247  _Node = _Node->_M_next;
248  delete _Tmp;
249  }
250  }
struct Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_Node Node

Member Function Documentation

bool Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::empty ( )
inline
259  {
260  return _M_begin == nullptr;
261  }
template<typename _Ty >
void Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::for_each ( _Ty  _Lambda)
inline
265  {
266  Node* _Node = _M_begin;
267 
268  while (_Node != nullptr)
269  {
270  _Lambda(_Node->_M_token);
271  _Node = _Node->_M_next;
272  }
273  }
struct Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_Node Node
void Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::push_back ( _CancellationTokenRegistration _Token)
inline
276  {
277  auto _Node = new Node(_Token);
278  if (_M_begin == nullptr)
279  {
280  _M_begin = _Node;
281  }
282  else
283  {
284  _M_last->_M_next = _Node;
285  }
286 
287  _M_last = _Node;
288  }
struct Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_Node Node
void Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::remove ( _CancellationTokenRegistration _Token)
inline
291  {
292  Node* _Node = _M_begin;
293  Node* _Prev = nullptr;
294 
295  while (_Node != nullptr)
296  {
297  if (_Node->_M_token == _Token) {
298  if (_Prev == nullptr)
299  {
300  _M_begin = _Node->_M_next;
301  }
302  else
303  {
304  _Prev->_M_next = _Node->_M_next;
305  }
306 
307  if (_Node->_M_next == nullptr)
308  {
309  _M_last = _Prev;
310  }
311 
312  delete _Node;
313  break;
314  }
315 
316  _Prev = _Node;
317  _Node = _Node->_M_next;
318  }
319  }
struct Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_Node Node
void Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::swap ( TokenRegistrationContainer _List)
inline
253  {
254  std::swap(_List._M_begin, _M_begin);
255  std::swap(_List._M_last, _M_last);
256  }
void swap(any &_Left, any &_Right) _NOEXCEPT
Definition: any:450

Member Data Documentation

Node* Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_M_begin
private
Node* Concurrency::details::_CancellationTokenState::TokenRegistrationContainer::_M_last
private

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