当前位置: 首页>>代码示例>>C++>>正文


C++ EventArray::AddEvent方法代码示例

本文整理汇总了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());
		}

	}
开发者ID:Alzathar,项目名称:Open3DMotion,代码行数:17,代码来源:EventGroup.cpp

示例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
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例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
}
开发者ID:,项目名称:,代码行数:20,代码来源:


注:本文中的EventArray::AddEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。