#include <utilities/timer.h>
Открытые члены | |
Timer (void) | |
void | SetTimeout (const std::size_t theTimeout) |
void | SetInstant (const bool theInstant) |
void | SetSingle (const bool theSingle) |
void | Run (void) |
virtual void | Action (void) |
virtual | ~Timer () |
Закрытые члены | |
Timer (const Timer &) | |
Timer | operator= (const Timer &) |
Закрытые данные | |
std::size_t | Timeout |
bool | Instant |
bool | Single |
ThreadAbstraction | TimerThread |
Друзья | |
void * | _TimerWrapperFunction (void *) |
См. определение в файле timer.h строка 44
nitro::Timer::Timer | ( | void | ) |
nitro::Timer::~Timer | ( | ) | [virtual] |
Виртуальный деструктор.
См. определение в файле timer.cpp строка 125
{ try { } catch( nitro::exception e ) { } catch( ... ) { } }
nitro::Timer::Timer | ( | const Timer & | ) | [inline, private] |
void nitro::Timer::Action | ( | void | ) | [virtual] |
Функция действия таймера.
nitro::exception | Кидает исключение этого типа с описанием ошибки. |
См. определение в файле timer.cpp строка 110
Перекрестные ссылки nitro::exception::code() и nitro::exception::what().
Используется в nitro::_TimerWrapperFunction().
{ try { } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Timer::Action( void )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Timer::Action( void )::An error occured" ) , 0 ) ); } }
void nitro::Timer::Run | ( | void | ) |
Функция запуска таймера.
nitro::exception | Кидает исключение этого типа с описанием ошибки. |
См. определение в файле timer.cpp строка 94
Перекрестные ссылки _TimerWrapperFunction, nitro::exception::code(), nitro::ThreadAbstraction::CreateThread(), TimerThread и nitro::exception::what().
{ try { TimerThread.CreateThread( _TimerWrapperFunction , ( void * )( Timer * )this ); } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Timer::Run( void )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Timer::Run( void )::An error occured" ) , 0 ) ); } }
void nitro::Timer::SetInstant | ( | const bool | theInstant | ) |
Функция установки поля Instant.
theInstant | - флаг моментального запуска. |
nitro::exception | Кидает исключение этого типа с описанием ошибки. |
См. определение в файле timer.cpp строка 35
Перекрестные ссылки nitro::exception::code(), Instant и nitro::exception::what().
{ try { Instant = theInstant; } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Timer::SetInstant( const bool theInstant )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Timer::SetInstant( const bool theInstant )::An error occured" ) , 0 ) ); } }
void nitro::Timer::SetSingle | ( | const bool | theSingle | ) |
Функция установки поля Instant.
theSingle | - флаг удинственного запуска. |
nitro::exception | Кидает исключение этого типа с описанием ошибки. |
См. определение в файле timer.cpp строка 51
Перекрестные ссылки nitro::exception::code(), Single и nitro::exception::what().
{ try { Single = theSingle; } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Timer::SetSingle( const bool theSingle )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Timer::SetSingle( const bool theSingle )::An error occured" ) , 0 ) ); } }
void nitro::Timer::SetTimeout | ( | const std::size_t | theTimeout | ) |
Функция установки таймаута.
theTimeout | - Таймаут. |
nitro::exception | Кидает исключение этого типа с описанием ошибки. |
См. определение в файле timer.cpp строка 19
Перекрестные ссылки nitro::exception::code(), Timeout и nitro::exception::what().
{ try { Timeout = theTimeout; } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Timer::SetTimeout( const std::size_t theTimeout )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Timer::SetTimeout( const std::size_t theTimeout )::An error occured" ) , 0 ) ); } }
void* _TimerWrapperFunction | ( | void * | Param | ) | [friend] |
Функция для потока таймера.
См. определение в файле timer.cpp строка 67
Используется в Run().
{ Timer * TimerPtr( ( Timer * ) Param ); if( TimerPtr->Instant ) { TimerPtr->Action(); if( TimerPtr->Single ) { return( NULL ); } } for( ; true ; ) { ThreadAbstraction::Sleep( TimerPtr->Timeout ); TimerPtr->Action(); if( TimerPtr->Single ) { return( NULL ); } } }
bool nitro::Timer::Instant [private] |
Сразу ли запускать действие.
См. определение в файле timer.h строка 191
Используется в nitro::_TimerWrapperFunction(), SetInstant() и Timer().
bool nitro::Timer::Single [private] |
Одиночное выполнение действие.
См. определение в файле timer.h строка 203
Используется в nitro::_TimerWrapperFunction(), SetSingle() и Timer().
std::size_t nitro::Timer::Timeout [private] |
Таймаут на выполнения действия.
См. определение в файле timer.h строка 179
Используется в nitro::_TimerWrapperFunction(), SetTimeout() и Timer().
ThreadAbstraction nitro::Timer::TimerThread [private] |