#include <mn_tickhook_entry.hpp>

+ Collaboration diagram for mn::base_tickhook_entry:

Public Member Functions

 base_tickhook_entry (unsigned int iTicksToCall, bool bOneShoted=false, void *pUserData=0)
 
 base_tickhook_entry (const base_tickhook_entry &)=delete
 
bool set_ticks (unsigned int uiTicks)
 
bool set_oneshot (bool bIsOneShot)
 
void start ()
 
void stop ()
 
bool is_oneshoted ()
 
bool is_ready ()
 
unsigned int get_ticks ()
 

Protected Member Functions

virtual void onTick (const unsigned int ticks)=0
 

Protected Attributes

void * m_pUserData
 
unsigned int m_iTicksToCall
 
bool m_bOneShoted
 
bool m_bReady
 
mutex_t m_mutexEntry
 

Friends

class base_tickhook
 

Detailed Description

This is an abstract base class for a entry of base_tickhook.

To use this, you need to subclass it. All of your coroutines should be derived from the base_tickhook_entry class. Then implement the virtual on_hook function.

Constructor & Destructor Documentation

◆ base_tickhook_entry() [1/2]

mn::base_tickhook_entry::base_tickhook_entry ( unsigned int  iTicksToCall,
bool  bOneShoted = false,
void *  pUserData = 0 
)

Constructor

Parameters
iTicksToCallThe number of ticks left after this run
bOneShotedIf the hook oneshoted ?
pArgsa array of arguments.
numArgsHow many arguments are contains in the array pArgs.

◆ base_tickhook_entry() [2/2]

mn::base_tickhook_entry::base_tickhook_entry ( const base_tickhook_entry )
delete

Member Function Documentation

◆ get_ticks()

unsigned int mn::base_tickhook_entry::get_ticks ( )

◆ is_oneshoted()

bool mn::base_tickhook_entry::is_oneshoted ( )

◆ is_ready()

bool mn::base_tickhook_entry::is_ready ( )

◆ onTick()

virtual void mn::base_tickhook_entry::onTick ( const unsigned int  ticks)
protectedpure virtual

◆ set_oneshot()

bool mn::base_tickhook_entry::set_oneshot ( bool  bIsOneShot)

Set the is this entry oneshot?

Parameters
bIsOneShotIf true then oneshoted this entry and removed after run.

◆ set_ticks()

bool mn::base_tickhook_entry::set_ticks ( unsigned int  uiTicks)

Set the number of ticks after this run. When param uiTicks 0 is, then run every tick.

Parameters
uiTicksThe number of ticks left after this run

◆ start()

void mn::base_tickhook_entry::start ( )

Marked the hook as ready, after this you can not modifitated the hook

◆ stop()

void mn::base_tickhook_entry::stop ( )

Friends And Related Function Documentation

◆ base_tickhook

friend class base_tickhook
friend

Member Data Documentation

◆ m_bOneShoted

bool mn::base_tickhook_entry::m_bOneShoted
protected

◆ m_bReady

bool mn::base_tickhook_entry::m_bReady
protected

◆ m_iTicksToCall

unsigned int mn::base_tickhook_entry::m_iTicksToCall
protected

◆ m_mutexEntry

mutex_t mn::base_tickhook_entry::m_mutexEntry
protected

◆ m_pUserData

void* mn::base_tickhook_entry::m_pUserData
protected

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