本文整理汇总了C++中NF_SHARE_PTR::GetUpload方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetUpload方法的具体用法?C++ NF_SHARE_PTR::GetUpload怎么用?C++ NF_SHARE_PTR::GetUpload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetUpload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: Load
bool NFCElementModule::Load(rapidxml::xml_node<>* attrNode, NF_SHARE_PTR<NFIClass> pLogicClass)
{
//attrNode is the node of a object
std::string strConfigID = attrNode->first_attribute("Id")->value();
if (strConfigID.empty())
{
NFASSERT(0, strConfigID, __FILE__, __FUNCTION__);
return false;
}
if (ExistElement(strConfigID))
{
NFASSERT(0, strConfigID, __FILE__, __FUNCTION__);
return false;
}
NF_SHARE_PTR<ElementConfigInfo> pElementInfo(NF_NEW ElementConfigInfo());
AddElement(strConfigID, pElementInfo);
//can find all configid by class name
pLogicClass->AddId(strConfigID);
//ElementConfigInfo* pElementInfo = CreateElement( strConfigID, pElementInfo );
NF_SHARE_PTR<NFIPropertyManager> pElementPropertyManager = pElementInfo->GetPropertyManager();
NF_SHARE_PTR<NFIRecordManager> pElementRecordManager = pElementInfo->GetRecordManager();
//1.add property
//2.set the default value of them
NF_SHARE_PTR<NFIPropertyManager> pClassPropertyManager = pLogicClass->GetPropertyManager();
NF_SHARE_PTR<NFIRecordManager> pClassRecordManager = pLogicClass->GetRecordManager();
if (pClassPropertyManager && pClassRecordManager)
{
NF_SHARE_PTR<NFIProperty> pProperty = pClassPropertyManager->First();
while (pProperty)
{
pElementPropertyManager->AddProperty(NFGUID(), pProperty);
pProperty = pClassPropertyManager->Next();
}
NF_SHARE_PTR<NFIRecord> pRecord = pClassRecordManager->First();
while (pRecord)
{
NF_SHARE_PTR<NFIRecord> xRecord = pElementRecordManager->AddRecord(NFGUID(), pRecord->GetName(), pRecord->GetInitData(), pRecord->GetTag(), pRecord->GetRows());
xRecord->SetPublic(pRecord->GetPublic());
xRecord->SetPrivate(pRecord->GetPrivate());
xRecord->SetSave(pRecord->GetSave());
xRecord->SetCache(pRecord->GetCache());
xRecord->SetUpload(pRecord->GetUpload());
pRecord = pClassRecordManager->Next();
}
}
//3.set the config value to them
//const char* pstrConfigID = attrNode->first_attribute( "ID" );
for (rapidxml::xml_attribute<>* pAttribute = attrNode->first_attribute(); pAttribute; pAttribute = pAttribute->next_attribute())
{
const char* pstrConfigName = pAttribute->name();
const char* pstrConfigValue = pAttribute->value();
//printf( "%s : %s\n", pstrConfigName, pstrConfigValue );
NF_SHARE_PTR<NFIProperty> temProperty = pElementPropertyManager->GetElement(pstrConfigName);
if (!temProperty)
{
continue;
}
NFIDataList::TData var;
const TDATA_TYPE eType = temProperty->GetType();
switch (eType)
{
case TDATA_INT:
{
if (!LegalNumber(pstrConfigValue))
{
NFASSERT(0, temProperty->GetKey(), __FILE__, __FUNCTION__);
}
var.SetInt(lexical_cast<NFINT64>(pstrConfigValue));
}
break;
case TDATA_FLOAT:
{
if (strlen(pstrConfigValue) <= 0)
{
NFASSERT(0, temProperty->GetKey(), __FILE__, __FUNCTION__);
}
var.SetFloat((double)atof(pstrConfigValue));
}
break;
case TDATA_STRING:
{
var.SetString(pstrConfigValue);
}
break;
case TDATA_OBJECT:
//.........这里部分代码省略.........