QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlIncrement< INT > Class Template Reference

A class which safely increment and equivalently decrement a counter. More...

Public Member Functions

 QtlIncrement (INT *counter=0, INT increment=1)
 Constructor. More...
 
 ~QtlIncrement ()
 Destructor, decrement the counter. More...
 

Private Attributes

INT * _counter
 The address of the counter to increment. More...
 
INT _increment
 The amount of unit to decrement in destructor. More...
 

Detailed Description

template<typename INT>
class QtlIncrement< INT >

A class which safely increment and equivalently decrement a counter.

Template Parameters
INTThe integer type of the counter to increment.

Constructor & Destructor Documentation

◆ QtlIncrement()

template<typename INT >
QtlIncrement< INT >::QtlIncrement ( INT *  counter = 0,
INT  increment = 1 
)
inlineexplicit

Constructor.

Parameters
[in,out]counterThe address of the counter to increment. Can be null.
[in]incrementThe amount of unit to increment. Default to 1.

◆ ~QtlIncrement()

template<typename INT >
QtlIncrement< INT >::~QtlIncrement ( )
inline

Destructor, decrement the counter.

The counter is decremented by the same amount as it was incremented in the constructor.

Member Data Documentation

◆ _counter

template<typename INT >
INT* QtlIncrement< INT >::_counter
private

The address of the counter to increment.

◆ _increment

template<typename INT >
INT QtlIncrement< INT >::_increment
private

The amount of unit to decrement in destructor.


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