📄 sesseltimeout.h
字号:
#ifndef SESSELTIMEOUT_H
#define SESSELTIMEOUT_H
#include <sys/select.h>
#include <sys/time.h>
#include <time.h>
#include <vector>
typedef struct timeval SelTime_T;
SelTime_T operator+ (SelTime_T &t1, SelTime_T &t2);
SelTime_T operator- (SelTime_T &t1, SelTime_T &t2);
bool operator> (SelTime_T &t1, SelTime_T &t2);
bool operator< (SelTime_T &t1, SelTime_T &t2);
bool operator== (SelTime_T &t1, SelTime_T &t2);
struct TimeOutStruct_T
{
TimeOutStruct_T (SelTime_T timeout, time_t timerepeat, char* msgsourcename)
{
t.tv_sec = timeout.tv_sec;
t.tv_usec = timeout.tv_usec;
rt = timerepeat;
strcpy(MsgSourceName, msgsourcename);
}
SelTime_T t;
time_t rt;
char MsgSourceName[256];
};
typedef std::vector<TimeOutStruct_T> TOSVct_T;
class sesSelTimeOut
{
public:
void AddTimeOut (SelTime_T &t, time_t rt, char* MsgSourceName);
void ClearAllTimeOut (void);
void DelTimeOut (char* MsgSourceName);
void DelTimeOut (SelTime_T &t, time_t rt, char* MsgSourceName);
bool ExistTimeOut (SelTime_T &t, time_t rt, char* MsgSourceName);
void RaiseTimeOut (SelTime_T &t, time_t rt, char* MsgSourceName);
void ShowInfo (void);
SelTime_T GetFirstTimeOut (void);
private:
TOSVct_T tosVct;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -