A special wrapper to be used to hold an actual timer object which is not allocated dynamically.
More...
template<typename Actual_Object>
class timertt::scoped_timer_object_holder< Actual_Object >
A special wrapper to be used to hold an actual timer object which is not allocated dynamically.
This class is a part of support for scoped timer objects. Every timer engine will define its own scoped_timer_object
by using this template class. Something like:
class some_engine
{
struct timer_type { ... };
public :
using scoped_timer_object = scoped_timer_object_holder<timer_type>;
...
};
- Some implementation details.
- Version 1.2.0 doesn't change way of working with actual timer objects. They are still reference countable. It means that when a scoped timer object is passed to engine's
activate
method a reference count will be incremented. When this object is passed to deactivate
method then reference counter will be decremented. If reference counter becomes zero then the timer object will be deallocated by calling delete
. To prevent this scoped_timer_object_holder automatically incremented reference counter by 1 in the constructor. It means that the reference counter will not be zero (in normal scenarios).
- Note
- This type is not Copyable nor Moveable.
- Since
- v.1.2.0