本文整理汇总了C++中NF_SHARE_PTR::GetRef方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetRef方法的具体用法?C++ NF_SHARE_PTR::GetRef怎么用?C++ NF_SHARE_PTR::GetRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetRef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: pNewProperty
NF_SHARE_PTR<NFIProperty> NFCPropertyManager::AddProperty(const NFGUID& self, NF_SHARE_PTR<NFIProperty> pProperty)
{
const std::string& strProperty = pProperty->GetKey();
NF_SHARE_PTR<NFIProperty> pOldProperty = this->GetElement(strProperty);
if (!pOldProperty)
{
NF_SHARE_PTR<NFIProperty> pNewProperty(NF_NEW NFCProperty(self, strProperty, pProperty->GetType()));
pNewProperty->SetPublic(pProperty->GetPublic());
pNewProperty->SetPrivate(pProperty->GetPrivate());
pNewProperty->SetSave(pProperty->GetSave());
pNewProperty->SetCache(pProperty->GetCache());
pNewProperty->SetRef(pProperty->GetRef());
pNewProperty->SetUpload(pProperty->GetUpload());
this->AddElement(strProperty, pNewProperty);
}
return pOldProperty;
}
示例3: 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;
}