本文整理汇总了C++中EventHandler::GetWaitingEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ EventHandler::GetWaitingEvent方法的具体用法?C++ EventHandler::GetWaitingEvent怎么用?C++ EventHandler::GetWaitingEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventHandler
的用法示例。
在下文中一共展示了EventHandler::GetWaitingEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DisableReading
void EventScheduler::DisableReading(EventHandler& handle)
{
int waiting_event = handle.GetWaitingEvent();
if(waiting_event == EPOLLIN)
{
UninstallEvent(handle, kReadEvent);
ModifyEvent(handle);
}
else
{
FILE_LOG(logERROR)<<"the handle already has been disabling reading";
}
}
示例2: DisableWriting
void EventScheduler::DisableWriting(EventHandler& handle)
{
int waiting_event = handle.GetWaitingEvent();
if(waiting_event == EPOLLOUT)
{
UninstallEvent(handle, kWriteEvent);
ModifyEvent(handle);
}
else
{
FILE_LOG(logERROR)<<"the handle already has waiting to write";
}
}
示例3: EnableReading
void EventScheduler::EnableReading(EventHandler& handle)
{
int waiting_event = handle.GetWaitingEvent();
if(0 == waiting_event)
{
FILE_LOG(logINFO)<<" enableread";
InstallEvent(handle, kReadEvent);
AddEvent(handle);
}
else if(waiting_event != EPOLLIN)
{
InstallEvent(handle, kReadEvent);
ModifyEvent(handle);
}
else
{
//LOG
FILE_LOG(logERROR)<<"the handle already has waiting to read";
}
}
示例4: UninstallEvent
void EventScheduler::UninstallEvent(EventHandler& handle, int event)
{
int waiting_event = handle.GetWaitingEvent();
waiting_event &= ~event;
handle.SetWaitingEvent(waiting_event);
}