本文整理汇总了C++中EventArray::AddEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ EventArray::AddEvent方法的具体用法?C++ EventArray::AddEvent怎么用?C++ EventArray::AddEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventArray
的用法示例。
在下文中一共展示了EventArray::AddEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEvents
void EventGroup::GetEvents(EventArray& events) const
{
// put all names in list
size_t num_names = EventMap.NumElements();
for (size_t iname = 0; iname < num_names; iname++)
{
const EventNameID& nameid = EventMap[iname];
events.SetIDName(nameid.ID, nameid.Name);
}
// put all event times
for (EventGroupConstIter i(*this); i.HasFrame(); i.Next())
{
events.AddEvent(i.Time(), i.ID());
}
}
示例2: IsOverlappedReceiveReady
bool Socket::IsOverlappedReceiveReady() const
{
if (IsUDPSlaveSocket()) // UDP slave sockets are never read directly. For these sockets, act as if they're never ready for reads.
return false;
#ifdef WIN32
if (queuedReceiveBuffers.Size() == 0)
return false;
return Event((*queuedReceiveBuffers.Front())->overlapped.hEvent, EventWaitRead).Test();
#else
if (!readOpen)
return false;
EventArray ea;
ea.AddEvent(Event(connectSocket, EventWaitRead));
return ea.Wait(0) == 0;
#endif
}
示例3: IsOverlappedSendReady
bool Socket::IsOverlappedSendReady()
{
if (!writeOpen)
return false;
#ifdef WIN32
if (queuedSendBuffers.CapacityLeft() > 0)
return true;
OverlappedTransferBuffer *sentData = *queuedSendBuffers.Front();
DWORD flags = 0;
BOOL ret = WSAGetOverlappedResult(connectSocket, &sentData->overlapped, (LPDWORD)&sentData->bytesContains,
FALSE, &flags);
return ret == TRUE;
#else
EventArray ea;
ea.AddEvent(Event(connectSocket, EventWaitWrite));
return ea.Wait(0) == 0;
#endif
}