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


C++ NF_SHARE_PTR::GetAddress方法代码示例

本文整理汇总了C++中NF_SHARE_PTR::GetAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetAddress方法的具体用法?C++ NF_SHARE_PTR::GetAddress怎么用?C++ NF_SHARE_PTR::GetAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NF_SHARE_PTR的用法示例。


在下文中一共展示了NF_SHARE_PTR::GetAddress方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExecuteEvent

bool NFActorModule::ExecuteEvent()
{
	NFIActorMessage xMsg;
	bool bRet = false;
	bRet = mxQueue.TryPop(xMsg);
	while (bRet)
	{
		if (xMsg.msgType != NFIActorMessage::ACTOR_MSG_TYPE_COMPONENT && xMsg.xEndFuncptr != nullptr)
		{
			//Actor can be reused in ActorPool mode, so we don't release it.
			//>ReleaseActor(xMsg.nFormActor);
			ACTOR_PROCESS_FUNCTOR* pFun = xMsg.xEndFuncptr.get();
			pFun->operator()(xMsg.nFormActor, xMsg.nMsgID, xMsg.data);


			NF_SHARE_PTR<NFIActor> xActor = mxActorMap.GetElement(xMsg.nFormActor);
			if (xActor)
			{
				if (xActor->GetNumQueuedMessages() <= 0)
				{
					int nActorID = xActor->GetAddress().AsInteger();
					if (mxActorPool.find(nActorID) == mxActorPool.end())
					{
						mxActorPool.insert(std::pair<int, int>(nActorID, 0));
					}
				}
			}
		}

		bRet = mxQueue.TryPop(xMsg);
	}

	return true;
}
开发者ID:ketoo,项目名称:NoahGameFrame,代码行数:34,代码来源:NFActorModule.cpp

示例2: RequireActor

int NFActorModule::RequireActor()
{
	NF_SHARE_PTR<NFIActor> pActor = nullptr;
	if (mxActorPool.size() <= 0)
	{
		pActor = NF_SHARE_PTR<NFIActor>(NF_NEW NFActor(mFramework, this));
		mxActorMap.AddElement(pActor->GetAddress().AsInteger(), pActor);

		return pActor->GetAddress().AsInteger();
	}

	std::map<int, int>::iterator it = mxActorPool.begin();
	int nActorID = it->first;
	mxActorPool.erase(it);

    return nActorID;
}
开发者ID:ketoo,项目名称:NoahGameFrame,代码行数:17,代码来源:NFActorModule.cpp

示例3: SendMsgToActor

bool NFActorModule::SendMsgToActor(const int nActorIndex, const int nEventID, const std::string& strArg)
{
    NF_SHARE_PTR<NFIActor> pActor = GetActor(nActorIndex);
    if (nullptr != pActor)
    {
        NFIActorMessage xMessage;

        xMessage.msgType = NFIActorMessage::ACTOR_MSG_TYPE_COMPONENT;
        xMessage.data = strArg;
        xMessage.nMsgID = nEventID;
        xMessage.nFormActor = m_pMainActor->GetAddress().AsInteger();

        return mFramework.Send(xMessage, m_pMainActor->GetAddress(), pActor->GetAddress());
    }

    return false;
}
开发者ID:ketoo,项目名称:NoahGameFrame,代码行数:17,代码来源:NFActorModule.cpp

示例4: SendMsgToActor

bool NFCActorManager::SendMsgToActor( const int nActorIndex, const NFGUID& objectID, const int nEventID, const std::string& strArg)
{
	NF_SHARE_PTR<NFIActor> pActor = GetActor(nActorIndex);
    if (nullptr != pActor)
    {
        NFIActorMessage xMessage;

        xMessage.eType = NFIActorMessage::EACTOR_EVENT_MSG;
        xMessage.data = strArg;
        xMessage.nSubMsgID = nEventID;
		xMessage.nFormActor = m_pMainActor->GetAddress().AsInteger();
        xMessage.self = objectID;

        return m_pFramework->Send(xMessage, m_pMainActor->GetAddress(), pActor->GetAddress());
    }

	return false;
}
开发者ID:AnakinSong,项目名称:NoahGameFrame,代码行数:18,代码来源:NFCActorManager.cpp

示例5: SendMsgToActor

bool NFCActorModule::SendMsgToActor(const int nActorIndex, const NFGUID& objectID, const int nEventID, const std::string& strArg)
{
    NF_SHARE_PTR<NFIActor> pActor = GetActor(nActorIndex);
    if (nullptr != pActor)
    {
        NFIActorMessage xMessage;

		xMessage.bComponentMsg = true;
        xMessage.data = strArg;
        xMessage.nMsgID = nEventID;
        xMessage.nFormActor = m_pMainActor->GetAddress().AsInteger();
        xMessage.self = objectID;

        return m_pFramework->Send(xMessage, m_pMainActor->GetAddress(), pActor->GetAddress());
    }

    return false;
}
开发者ID:,项目名称:,代码行数:18,代码来源:


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