SObjectizer  5.5
Public Member Functions | Private Attributes | List of all members
timertt::scoped_timer_object_holder< Actual_Object > Class Template Reference

A special wrapper to be used to hold an actual timer object which is not allocated dynamically. More...

#include <all.hpp>

Public Member Functions

 scoped_timer_object_holder ()
 
 scoped_timer_object_holder (const scoped_timer_object_holder &)=delete
 
 scoped_timer_object_holder (scoped_timer_object_holder &&)=delete
 
Actual_Object * ptr ()
 

Private Attributes

Actual_Object m_object
 

Detailed Description

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

Constructor & Destructor Documentation

◆ scoped_timer_object_holder() [1/3]

template<typename Actual_Object >
timertt::scoped_timer_object_holder< Actual_Object >::scoped_timer_object_holder ( )
inline

◆ scoped_timer_object_holder() [2/3]

template<typename Actual_Object >
timertt::scoped_timer_object_holder< Actual_Object >::scoped_timer_object_holder ( const scoped_timer_object_holder< Actual_Object > &  )
delete

◆ scoped_timer_object_holder() [3/3]

template<typename Actual_Object >
timertt::scoped_timer_object_holder< Actual_Object >::scoped_timer_object_holder ( scoped_timer_object_holder< Actual_Object > &&  )
delete

Member Function Documentation

◆ ptr()

template<typename Actual_Object >
Actual_Object* timertt::scoped_timer_object_holder< Actual_Object >::ptr ( )
inline

Member Data Documentation

◆ m_object

template<typename Actual_Object >
Actual_Object timertt::scoped_timer_object_holder< Actual_Object >::m_object
private

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