STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Private Member Functions | List of all members
stdext::allocators::sync_per_thread< _Cache > Class Template Reference

Public Member Functions

_DECLSPEC_ALLOCATOR voidallocate (size_t _Count)
 
void deallocate (void *_Ptr, size_t _Count)
 
bool equals (const sync_per_thread< _Cache > &_Other) const
 

Static Private Member Functions

static __declspec (thread) _Cache *_Mycache_ptr
 

Member Function Documentation

template<class _Cache >
static stdext::allocators::sync_per_thread< _Cache >::__declspec ( thread  )
staticprivate
template<class _Cache >
_DECLSPEC_ALLOCATOR void* stdext::allocators::sync_per_thread< _Cache >::allocate ( size_t  _Count)
inline
166  { // allocate from cache
167  if (_Mycache_ptr == 0)
168  _Mycache_ptr = new _Cache();
169  return (_Mycache_ptr != 0 ? _Mycache_ptr->allocate(_Count) : 0);
170  }
_Diff _Count
Definition: algorithm:1941
template<class _Cache >
void stdext::allocators::sync_per_thread< _Cache >::deallocate ( void _Ptr,
size_t  _Count 
)
inline
173  { // deallocate through cache
174  if (_Mycache_ptr != 0)
175  _Mycache_ptr->deallocate(_Ptr, _Count);
176  }
_Diff _Count
Definition: algorithm:1941
template<class _Cache >
bool stdext::allocators::sync_per_thread< _Cache >::equals ( const sync_per_thread< _Cache > &  _Other) const
inline
179  { // compare two caches for equality
180  return (_Mycache_ptr != 0
181  && _Other._Mycache_ptr != 0
182  && _Mycache_ptr->equals(*_Other._Mycache_ptr));
183  }

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