📄 wyselect.h
字号:
/* Copyright license: GNU LGPL (see file COPYING) by I.J.Wang (2004)*/#ifndef WYSELECT_H__#define WYSELECT_H__#define WYSELECT_VERSION 31#include "wytimespec.h"#include "wyfilehandle.h"#include "wysysfile.h"#include <sys/select.h>class WySysFile;class Wy_FdSet;namespace Wy { WyRet select(Wy_FdSet* rd_set, Wy_FdSet* wr_set, Wy_FdSet* excp_set); WyRet select(Wy_FdSet* rd_set, Wy_FdSet* wr_set, Wy_FdSet* excp_set,const WyTimeSpec& timeout); WyRet select(Wy_FdSet* readfds, Wy_FdSet* writefds, Wy_FdSet* exceptfds,WyTimeSpec& timeout);};// Wy_FdSet wrapper of ::fd_set//class Wy_FdSet { static const int DefaultMaxFd=-1; // must be -1, see clr(...), and // ::select(max+1,...) public: static const char class_name[]; WY_THROW_REPLY; Wy_FdSet() WY__TSPC(); Wy_FdSet(const Wy_FdSet&) WY__TSPC(); Wy_FdSet(Wy_FdSet&,Wy::ByMove_t) WY__TSPC(); void reset(void) WY__TSPC(); void reset(const Wy_FdSet&) WY__TSPC(); void swap(Wy_FdSet&) WY__TSPC(); //const Wy_FdSet& operator =(const Wy_FdSet& src) WY__TSPC(); bool is_set(WyFileHandle fh) const WY__TSPC(); bool is_set(const WySysFile&) const WY__TSPC(); void set(WyFileHandle fh) WY__TSPC(); void set(const WySysFile&) WY__TSPC(); void clr(WyFileHandle fh) WY__TSPC(); void clr(const WySysFile&) WY__TSPC(); //bool operator==(const Wy_FdSet& rhs) const WY__TSPC(); //bool operator!=(const Wy_FdSet& rhs) const WY__TSPC() // { return !operator==(rhs); }; Wy__TypeFD wy_maxfd(void) const WY__NOTHROW__; // [Internal] Get the fd_set address of the internal member // // Note: Only called once until reset // // [Ret] The fd_set address of the internal member // =0, if not reset since last call // ::fd_set* wy_fdset_ptr(void) WY__NOTHROW__; private: Wy__TypeFD _maxfd; bool _sel_used; // flag indicating ::select(...) had used _fdset; ::fd_set _fdset;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -