mn::basic_safe_counter< T, TLOCK > Class Template Reference
safe counter is a base of thread saftly counter More...
#include <mn_safecounter.hpp>
Public Types | |
using | value_type = T |
using | self_type = basic_safe_counter< T, TLOCK > |
using | lock_type = TLOCK |
using | lock_ptr_type = pointer::basic_lock_ptr< T, TLOCK > |
Public Member Functions | |
basic_safe_counter () | |
Construct a new basic safe counter object. More... | |
basic_safe_counter (value_type start) | |
Construct a new basic safe counter object. More... | |
self_type & | operator++ () |
thread saftly increment operator More... | |
self_type & | operator-- () |
thread saftly decrement operator More... | |
value_type | count () |
get the current count More... | |
Protected Attributes | |
lock_type | m_lockObject |
volatile value_type | m_iCount |
Detailed Description
template<typename T, class TLOCK>
class mn::basic_safe_counter< T, TLOCK >
safe counter is a base of thread saftly counter
Member Typedef Documentation
◆ lock_ptr_type
template<typename T , class TLOCK >
using mn::basic_safe_counter< T, TLOCK >::lock_ptr_type = pointer::basic_lock_ptr<T, TLOCK> |
◆ lock_type
template<typename T , class TLOCK >
using mn::basic_safe_counter< T, TLOCK >::lock_type = TLOCK |
◆ self_type
template<typename T , class TLOCK >
using mn::basic_safe_counter< T, TLOCK >::self_type = basic_safe_counter<T, TLOCK> |
◆ value_type
template<typename T , class TLOCK >
using mn::basic_safe_counter< T, TLOCK >::value_type = T |
Constructor & Destructor Documentation
◆ basic_safe_counter() [1/2]
template<typename T , class TLOCK >
|
inline |
Construct a new basic safe counter object.
◆ basic_safe_counter() [2/2]
template<typename T , class TLOCK >
|
inlineexplicit |
Construct a new basic safe counter object.
- Parameters
-
start Start value of this counter
Member Function Documentation
◆ count()
template<typename T , class TLOCK >
|
inline |
get the current count
◆ operator++()
template<typename T , class TLOCK >
|
inline |
thread saftly increment operator
◆ operator--()
template<typename T , class TLOCK >
|
inline |
thread saftly decrement operator
Member Data Documentation
◆ m_iCount
template<typename T , class TLOCK >
|
protected |
◆ m_lockObject
template<typename T , class TLOCK >
|
protected |
The documentation for this class was generated from the following file: