Giveda® Embedded Midware  1.2.0
本文档受《版权法》、《版权公约》保护。深圳技达®版权所有
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 友元 | 所有成员列表
GTimer类 参考

GTimer 定时器 更多...

#include <gTimer.h>

继承自 GObject .

Public 成员函数

 GTimer (GObject *parent=0, const char *name=0, bool sshot=false)
 构造一个定时器 更多...
 
virtual ~GTimer ()
 
bool isActive () const
 是否正在运行 更多...
 
int start (int msec, bool sshot=false)
 启动定时器 更多...
 
void stop ()
 停止定时器 更多...
 
int restart ()
 重新启动定时器 更多...
 
virtual bool event (GEvent *)
 开发者可以在子类中覆盖此函数,处理自己需要的事件 更多...
 
const char * name () const
 获取对象名称 更多...
 
GObjectparent () const
 获取对象的parent 更多...
 

静态 Public 成员函数

template<class Receiver >
static void singleShot (int msec, Receiver *receiver, void(Receiver::*SlotFunc)())
 执行一个一次性定时操作。超时会执行指定的槽函数 更多...
 
template<class Receiver , typename... Args>
static int connect (GObject *sender, GSignal< void(Args...)> &signal, Receiver *receiver, void(Receiver::*SlotFunc)(Args...))
 将信号和槽建立连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。 更多...
 
template<class Receiver , typename... Args>
static int disconnect (GObject *sender, GSignal< void(Args...)> &signal, Receiver *receiver, void(Receiver::*SlotFunc)(Args...))
 将信号和槽断开连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。 更多...
 
static bool isObjectExist (GObject *obj)
 判断对象是否已经被析构掉了。 更多...
 

Public 属性

GSignal< void(void)> timeout
 当定时器超时,该信号被发射。 更多...
 
GSignal< void(void)> sigDestroyed
 当对象被析构时,会发射此信号 更多...
 

友元

class GTimerEvent
 

详细描述

GTimer 定时器

构造及析构函数说明

GTimer::GTimer ( GObject parent = 0,
const char *  name = 0,
bool  sshot = false 
)

构造一个定时器

参数
parent...
name...
sshot系统保留参数,开发者不可使用,否则将给你带来莫名其妙的问题
virtual GTimer::~GTimer ( )
virtual

成员函数说明

template<class Receiver , typename... Args>
int GObject::connect ( GObject sender,
GSignal< void(Args...)> &  signal,
Receiver *  receiver,
void(Receiver::*)(Args...)  SlotFunc 
)
staticinherited

将信号和槽建立连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。

参数
sender指向发射者的指针
signal指向信号的引用。
receiver指向接收者的指针
SlotFunc指向槽函数的指针
返回
0代表成功;非0代表失败
template<class Receiver , typename... Args>
int GObject::disconnect ( GObject sender,
GSignal< void(Args...)> &  signal,
Receiver *  receiver,
void(Receiver::*)(Args...)  SlotFunc 
)
staticinherited

将信号和槽断开连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。

参数
sender指向发射者的指针
signal指向信号的引用。
receiver指向接收者的指针
SlotFunc指向槽函数的指针
返回
0代表成功;非0代表失败
virtual bool GTimer::event ( GEvent )
virtual

开发者可以在子类中覆盖此函数,处理自己需要的事件

参数
...
返回
bool

重载 GObject .

bool GTimer::isActive ( ) const

是否正在运行

返回
bool
static bool GObject::isObjectExist ( GObject obj)
staticinherited

判断对象是否已经被析构掉了。

参数
obj...
返回
bool true表示对象健在,false表示对象已经被析构掉了
const char* GObject::name ( ) const
inherited

获取对象名称

返回
const char*
GObject* GObject::parent ( ) const
inherited

获取对象的parent

返回
GObject*
int GTimer::restart ( )

重新启动定时器

返回
int
template<class Receiver >
static void GTimer::singleShot ( int  msec,
Receiver *  receiver,
void(Receiver::*)()  SlotFunc 
)
inlinestatic

执行一个一次性定时操作。超时会执行指定的槽函数

参数
msec超时,单位为毫秒
receiver接收者
SlotFunc接收者的槽函数(用于接收超时信号)
返回
void
int GTimer::start ( int  msec,
bool  sshot = false 
)

启动定时器

参数
msec超时,单位为毫秒
sshot
返回
int 是否single shot(超时一次就停止的定时器)
void GTimer::stop ( )

停止定时器

返回
void

友元及相关函数文档

friend class GTimerEvent
friend

类成员变量说明

GSignal<void(void)> GObject::sigDestroyed
inherited

当对象被析构时,会发射此信号

GSignal<void(void)> GTimer::timeout

当定时器超时,该信号被发射。


该类的文档由以下文件生成: