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