本文整理汇总了C++中NF_SHARE_PTR::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::Next方法的具体用法?C++ NF_SHARE_PTR::Next怎么用?C++ NF_SHARE_PTR::Next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::Next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TrailObjectData
int NFCPropertyTrailModule::TrailObjectData(const NFGUID& self)
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (nullptr == xObject)
{
return -1;
}
NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = xObject->GetPropertyManager();
if (nullptr != xPropertyManager)
{
NF_SHARE_PTR<NFIProperty> xProperty = xPropertyManager->First();
while (nullptr != xProperty)
{
m_pKernelModule->AddPropertyCallBack(self, xProperty->GetKey(), this, &NFCPropertyTrailModule::OnObjectPropertyEvent);
xProperty = xPropertyManager->Next();
}
}
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
if (nullptr != xRecordManager)
{
NF_SHARE_PTR<NFIRecord> xRecord = xRecordManager->First();
while (nullptr != xRecord)
{
m_pKernelModule->AddRecordCallBack(self, xRecord->GetName(), this, &NFCPropertyTrailModule::OnObjectRecordEvent);
xRecord = xRecordManager->Next();
}
}
return 0;
}
示例2: LogObjectData
int NFCPropertyTrailModule::LogObjectData(const NFGUID& self)
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (nullptr == xObject)
{
return -1;
}
NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = xObject->GetPropertyManager();
if (nullptr != xPropertyManager)
{
NF_SHARE_PTR<NFIProperty> xProperty = xPropertyManager->First();
while (nullptr != xProperty)
{
std::ostringstream stream;
stream << " Start trail ";
stream << xProperty->ToString();
m_pLogModule->LogProperty(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xProperty->GetKey(), stream.str(), __FUNCTION__, __LINE__);
xProperty = xPropertyManager->Next();
}
}
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
if (nullptr != xRecordManager)
{
NF_SHARE_PTR<NFIRecord> xRecord = xRecordManager->First();
while (nullptr != xRecord)
{
for (int i = 0; i < xRecord->GetRows(); ++i)
{
NFCDataList xDataList;
bool bRet = xRecord->QueryRow(i, xDataList);
if (bRet)
{
std::ostringstream stream;
stream << " Start trail Row[" << i << "]";
for (int j = 0; j < xDataList.GetCount(); ++j)
{
stream << " [" << j << "] " << xDataList.StringValEx(j);
}
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
}
xRecord = xRecordManager->Next();
}
}
return 0;
}
示例3: pRecordManager
NF_SHARE_PTR<NFIRecordManager> NFCCommonRedisModule::NewRecordManager(const std::string& strClassName)
{
NF_SHARE_PTR<NFIRecordManager> pStaticClassRecordManager = m_pLogicClassModule->GetClassRecordManager(strClassName);
if (pStaticClassRecordManager)
{
NFGUID ident;
NF_SHARE_PTR<NFIRecordManager> pRecordManager(NF_NEW NFCRecordManager(ident));
NF_SHARE_PTR<NFIRecord> pConfigRecordInfo = pStaticClassRecordManager->First();
while (pConfigRecordInfo)
{
if (pConfigRecordInfo->GetSave() || pConfigRecordInfo->GetCache())
{
NF_SHARE_PTR<NFIRecord> xRecord = pRecordManager->AddRecord(ident,
pConfigRecordInfo->GetName(),
pConfigRecordInfo->GetInitData(),
pConfigRecordInfo->GetTag(),
pConfigRecordInfo->GetRows());
xRecord->SetPublic(pConfigRecordInfo->GetPublic());
xRecord->SetPrivate(pConfigRecordInfo->GetPrivate());
xRecord->SetSave(pConfigRecordInfo->GetSave());
xRecord->SetCache(pConfigRecordInfo->GetCache());
}
pConfigRecordInfo = pStaticClassRecordManager->Next();
}
return pRecordManager;
}
return NF_SHARE_PTR<NFIRecordManager>(NULL);
}
示例4: CreateContinerObjectByFile
bool NFCSceneProcessModule::CreateContinerObjectByFile( const int nContainerID, const int nGroupID, const std::string& strFileName )
{
NF_SHARE_PTR<NFMapEx<std::string, SceneGroupResource>> pSceneResource = mtSceneResourceConfig.GetElement( nContainerID );
if ( pSceneResource.get() )
{
NF_SHARE_PTR<SceneGroupResource> pResourceMap = pSceneResource->GetElement( strFileName );
if ( pResourceMap.get() )
{
NF_SHARE_PTR<NFMapEx<std::string, SceneSeedResource>> pNPCResourceList = pResourceMap->xSceneGroupResource.GetElement( "NPC" );
if ( pNPCResourceList.get() )
{
NF_SHARE_PTR<SceneSeedResource> pResource = pNPCResourceList->First( );
while ( pResource.get() )
{
CreateContinerObject( nContainerID, nGroupID, strFileName, pResource->strSeedID );
pResource = pNPCResourceList->Next();
}
}
}
}
return true;
}
示例5: pPropertyManager
NF_SHARE_PTR<NFIPropertyManager> NFCCommonRedisModule::NewPropertyManager(const std::string& strClassName)
{
NF_SHARE_PTR<NFIPropertyManager> pStaticClassPropertyManager = m_pLogicClassModule->GetClassPropertyManager(strClassName);
if (pStaticClassPropertyManager)
{
NFGUID ident;
NF_SHARE_PTR<NFIPropertyManager> pPropertyManager(NF_NEW NFCPropertyManager(ident));
NF_SHARE_PTR<NFIProperty> pStaticConfigPropertyInfo = pStaticClassPropertyManager->First();
while (pStaticConfigPropertyInfo)
{
if (pStaticConfigPropertyInfo->GetSave() || pStaticConfigPropertyInfo->GetCache())
{
NF_SHARE_PTR<NFIProperty> xProperty = pPropertyManager->AddProperty(ident, pStaticConfigPropertyInfo->GetKey(), pStaticConfigPropertyInfo->GetType());
xProperty->SetPublic(pStaticConfigPropertyInfo->GetPublic());
xProperty->SetPrivate(pStaticConfigPropertyInfo->GetPrivate());
xProperty->SetSave(pStaticConfigPropertyInfo->GetSave());
xProperty->SetCache(pStaticConfigPropertyInfo->GetCache());
xProperty->SetRef(pStaticConfigPropertyInfo->GetRef());
}
pStaticConfigPropertyInfo = pStaticClassPropertyManager->Next();
}
return pPropertyManager;
}
return NF_SHARE_PTR<NFIPropertyManager>(NULL);
}
示例6: AddItemEffectDataProperty
int NFCItemModule::AddItemEffectDataProperty(const NFGUID& self, const NFGUID& xTarget, const std::string& strItemID)
{
if (strItemID.empty())
{
return 1;
}
//////////////////////////////////////////////////////////////////////////
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(xTarget);
if (NULL == pObject)
{
//m_pLogModule->LogObject(NFILogModule::NLL_ERROR_NORMAL, self, "There is no object", __FUNCTION__, __LINE__);
return 1;
}
//////////////////////////////////////////////////////////////////////////
NF_SHARE_PTR<NFIPropertyManager> pPropertyManager = m_pElementModule->GetPropertyManager(strItemID);
if (!pPropertyManager)
{
return 1;
}
NF_SHARE_PTR<NFIProperty> pEffectDataProperty = pPropertyManager->GetElement("EffectData");
if (!pEffectDataProperty)
{
return 1;
}
NF_SHARE_PTR<NFIPropertyManager> pEffectDataPropertyManager = m_pElementModule->GetPropertyManager(pEffectDataProperty->GetString());
if (!pEffectDataPropertyManager)
{
return 1;
}
NF_SHARE_PTR<NFIProperty> pProperty = pEffectDataPropertyManager->First();
while (pProperty)
{
if (pProperty->GetInt() != 0)
{
m_pPropertyModule->AddPropertyValue(xTarget, pProperty->GetKey(), NFIPropertyModule::NPG_EQUIP, pProperty->GetInt());
}
pProperty = pEffectDataPropertyManager->Next();
}
return 0;
}
示例7: DoEvent
bool NFCEventProcessModule::DoEvent(const NFIDENTID& objectID, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& valueList, const bool bSync)
{
NF_SHARE_PTR<NFCClassEventList> pEventList = mxClassEventInfoEx.GetElement(strClassName);
if (nullptr != pEventList)
{
CLASS_EVENT_FUNCTOR_PTR cb;
bool bRet = pEventList->First(cb);
while (bRet)
{
cb.get()->operator()(objectID, strClassName, eClassEvent, valueList);
bRet = pEventList->Next(cb);
}
}
return false;
}
示例8: NewPropertyManager
NF_SHARE_PTR<NFIPropertyManager> NFCCommonRedisModule::GetPropertyInfo(const NFGUID& self, const std::string& strClassName, std::vector<std::string>& vKeyCacheList, std::vector<std::string>& vValueCacheList)
{
//TODO optimize
NF_SHARE_PTR<NFIPropertyManager> pPropertyManager = NewPropertyManager(strClassName);
if (!pPropertyManager)
{
return nullptr;
}
NF_SHARE_PTR<NFIRedisClient> pDriver = m_pNoSqlModule->GetDriverBySuit(self.ToString());
if (!pDriver)
{
return nullptr;
}
//TODO
//just run this function one time
NF_SHARE_PTR<NFIProperty> xProperty = pPropertyManager->First();
while (xProperty)
{
if (xProperty->GetCache() || xProperty->GetSave())
{
vKeyCacheList.push_back(xProperty->GetKey());
}
xProperty = pPropertyManager->Next();
}
//cache
std::string strCacheKey = GetPropertyCacheKey(self);
if (!pDriver->HMGET(strCacheKey, vKeyCacheList, vValueCacheList))
{
return nullptr;
}
if (vKeyCacheList.size() == vValueCacheList.size())
{
ConvertVectorToPropertyManager(vKeyCacheList, vValueCacheList, pPropertyManager);
return pPropertyManager;
}
return nullptr;
}
示例9: NewRecordManager
NF_SHARE_PTR<NFIRecordManager> NFCCommonRedisModule::GetRecordInfo(const NFGUID& self, const std::string& strClassName, std::vector<std::string>& vKeyCacheList, std::vector<std::string>& vValueCacheList)
{
NF_SHARE_PTR<NFIRecordManager> pRecordManager = NewRecordManager(strClassName);
if (!pRecordManager.get())
{
return nullptr;
}
NF_SHARE_PTR<NFIRedisClient> pDriver = m_pNoSqlModule->GetDriverBySuit(self.ToString());
if (!pDriver)
{
return nullptr;
}
//TODO
//just run this function one time
NF_SHARE_PTR<NFIRecord> xRecord = pRecordManager->First();
while (xRecord)
{
if (xRecord->GetCache() || xRecord->GetSave())
{
vKeyCacheList.push_back(xRecord->GetName());
}
xRecord = pRecordManager->Next();
}
//cache
std::string strCacheKey = GetRecordCacheKey(self);
if (!pDriver->HMGET(strCacheKey, vKeyCacheList, vValueCacheList))
{
return nullptr;
}
if (vKeyCacheList.size() == vValueCacheList.size())
{
ConvertVectorToRecordManager(vKeyCacheList, vValueCacheList, pRecordManager);
return pRecordManager;
}
return nullptr;
}
示例10: Execute
bool NFCEventProcessModule::Execute(const float fLasFrametime, const float fStartedTime)
{
NFIDENTID ident;
NF_SHARE_PTR<NFList<int>> pList = mRemoveEventListEx.First(ident);
while (nullptr != pList)
{
//删除对象的某个事�?
NF_SHARE_PTR<NFCObjectEventInfo> pObjectEventInfo = mObjectEventInfoMapEx.GetElement(ident);
if (pObjectEventInfo)
{
int nEvent = 0;
bool bRet = pList->First(nEvent);
while (bRet)
{
pObjectEventInfo->RemoveElement(nEvent);
bRet = pList->Next(nEvent);
}
}
pList = NULL;
pList = mRemoveEventListEx.Next();
}
mRemoveEventListEx.ClearAll();
//////////////////////////////////////////////////////////////////////////
//删除事件对象
bool bRet = mRemoveObjectListEx.First(ident);
while (bRet)
{
mObjectEventInfoMapEx.RemoveElement(ident);
bRet = mRemoveObjectListEx.Next(ident);
}
mRemoveObjectListEx.ClearAll();
return true;
}
示例11: AddClass
bool NFCClassModule::AddClass(const char* pstrClassFilePath, NF_SHARE_PTR<NFIClass> pClass)
{
NF_SHARE_PTR<NFIClass> pParent = pClass->GetParent();
while (pParent)
{
//inherited some properties form class of parent
std::string strFileName = "";
pParent->First(strFileName);
while (!strFileName.empty())
{
if (pClass->Find(strFileName))
{
strFileName.clear();
continue;
}
if (AddClassInclude(strFileName.c_str(), pClass))
{
pClass->Add(strFileName);
}
strFileName.clear();
pParent->Next(strFileName);
}
pParent = pParent->GetParent();
}
//////////////////////////////////////////////////////////////////////////
if (AddClassInclude(pstrClassFilePath, pClass))
{
pClass->Add(pstrClassFilePath);
}
//file.close();
return true;
}
示例12: CheckRef
bool NFCElementModule::CheckRef()
{
NF_SHARE_PTR<NFIClass> pLogicClass = m_pClassModule->First();
while (pLogicClass)
{
NF_SHARE_PTR<NFIPropertyManager> pClassPropertyManager = pLogicClass->GetPropertyManager();
if (pClassPropertyManager)
{
NF_SHARE_PTR<NFIProperty> pProperty = pClassPropertyManager->First();
while (pProperty)
{
//if one property is ref,check every config
if (pProperty->GetRef())
{
NFList<std::string>& strIdList = pLogicClass->GetIdList();
std::string strId;
for (bool bRet = strIdList.First(strId); bRet; bRet = strIdList.Next(strId))
{
const std::string& strRefValue= this->GetPropertyString(strId, pProperty->GetKey());
if (!this->GetElement(strRefValue))
{
std::string msg;
msg.append("check ref failed id: ").append(strRefValue).append(" in ").append(pLogicClass->GetClassName());
NFASSERT(nRet, msg.c_str(), __FILE__, __FUNCTION__);
exit(0);
}
}
}
pProperty = pClassPropertyManager->Next();
}
}
//////////////////////////////////////////////////////////////////////////
pLogicClass = m_pClassModule->Next();
}
return false;
}
示例13: CreateSceneObject
bool NFCSceneProcessModule::CreateSceneObject( const int nSceneID, const int nGroupID)
{
NF_SHARE_PTR<NFMapEx<std::string, SceneSeedResource>> pSceneResource = mtSceneResourceConfig.GetElement( nSceneID );
if ( pSceneResource.get() )
{
NF_SHARE_PTR<SceneSeedResource> pResource = pSceneResource->First( );
while ( pResource.get() )
{
const std::string& strClassName = m_pElementInfoModule->GetPropertyString(pResource->strConfigID, NFrame::NPC::ClassName());
NFCDataList arg;
arg << NFrame::NPC::X() << pResource->fSeedX;
arg << NFrame::NPC::Y() << pResource->fSeedY;
arg << NFrame::NPC::Z() << pResource->fSeedZ;
arg << NFrame::NPC::SeedID() << pResource->strSeedID;
m_pKernelModule->CreateObject( NFGUID(), nSceneID, nGroupID, strClassName, pResource->strConfigID, arg );
pResource = pSceneResource->Next();
}
}
return true;
}
示例14: ConvertPropertyManagerToPB
bool NFCCreateRoleModule::ConvertPropertyManagerToPB(const NF_SHARE_PTR<NFIPropertyManager>& pProps, NFMsg::ObjectPropertyList * pPropertyData)
{
if (pProps)
{
NF_SHARE_PTR<NFIProperty> xPropert = pProps->First();
while (xPropert)
{
if (xPropert->GetCache() || xPropert->GetSave())
{
switch (xPropert->GetType())
{
case NFDATA_TYPE::TDATA_INT:
{
NFMsg::PropertyInt* pData = pPropertyData->add_property_int_list();
pData->set_property_name(xPropert->GetKey());
pData->set_data(xPropert->GetInt());
}
break;
case NFDATA_TYPE::TDATA_FLOAT:
{
NFMsg::PropertyFloat* pData = pPropertyData->add_property_float_list();
pData->set_property_name(xPropert->GetKey());
pData->set_data(xPropert->GetFloat());
}
break;
case NFDATA_TYPE::TDATA_OBJECT:
{
NFMsg::PropertyObject* pData = pPropertyData->add_property_object_list();
pData->set_property_name(xPropert->GetKey());
*(pData->mutable_data()) = NFINetModule::NFToPB(xPropert->GetObject());
}
break;
case NFDATA_TYPE::TDATA_STRING:
{
NFMsg::PropertyString* pData = pPropertyData->add_property_string_list();
pData->set_property_name(xPropert->GetKey());
pData->set_data(xPropert->GetString());
std::cout << xPropert->GetKey() << " " << xPropert->GetString() << std::endl;
}
break;
case NFDATA_TYPE::TDATA_VECTOR2:
{
NFMsg::PropertyVector2* pData = pPropertyData->add_property_vector2_list();
pData->set_property_name(xPropert->GetKey());
*(pData->mutable_data()) = NFINetModule::NFToPB(xPropert->GetVector2());
}
break;
case NFDATA_TYPE::TDATA_VECTOR3:
{
NFMsg::PropertyVector3* pData = pPropertyData->add_property_vector3_list();
pData->set_property_name(xPropert->GetKey());
*(pData->mutable_data()) = NFINetModule::NFToPB(xPropert->GetVector3());
}
break;
default:
break;
}
}
xPropert = pProps->Next();
}
}
return false;
}
示例15: ConvertRecordManagerToPB
bool NFCCreateRoleModule::ConvertRecordManagerToPB(const NF_SHARE_PTR<NFIRecordManager>& pRecordManager, NFMsg::ObjectRecordList * pRecordDataList)
{
if (pRecordDataList == nullptr)
{
return false;
}
for (NF_SHARE_PTR<NFIRecord> pRecord = pRecordManager->First(); pRecord != NULL; pRecord = pRecordManager->Next())
{
if (!pRecord->GetCache() && !pRecord->GetSave())
{
continue;
}
NFMsg::ObjectRecordBase* pRecordData = pRecordDataList->add_record_list();
if (!pRecordData)
{
continue;
}
ConvertRecordToPB(pRecord, pRecordData);
}
return true;
}