NF_SHARE_PTR<NFIProperty> NFCPropertyManager::AddProperty(const NFGUID& self, const std::string& strPropertyName, const NFDATA_TYPE varType) { NF_SHARE_PTR<NFIProperty> pProperty = this->GetElement(strPropertyName); if (!pProperty) { pProperty = NF_SHARE_PTR<NFIProperty>(NF_NEW NFCProperty(self, strPropertyName, varType)); this->AddElement(strPropertyName, pProperty); } return pProperty; }
NF_SHARE_PTR<NFIProperty> NFCPropertyManager::AddProperty(const NFIDENTID& self, const std::string& strPropertyName, const TDATA_TYPE varType, bool bPublic, bool bPrivate, bool bSave, bool bView, int nIndex, const std::string& strScriptFunction) { NF_SHARE_PTR<NFIProperty> pProperty = this->GetElement(strPropertyName); if (!pProperty.get()) { pProperty = NF_SHARE_PTR<NFIProperty>(NF_NEW NFCProperty(self, strPropertyName, varType, bPublic, bPrivate, bSave, bView, nIndex, strScriptFunction)); this->AddElement(strPropertyName, pProperty); if (pProperty->GetIndex() > 0) { mxPropertyIndexMap.insert(std::map<std::string, int>::value_type(strPropertyName, nIndex)); } } return pProperty; }
NF_SHARE_PTR<NFIProperty> NFCPropertyManager::AddProperty(const NFIDENTID& self, NF_SHARE_PTR<NFIProperty> pProperty) { const std::string& strProperty = pProperty->GetKey(); NF_SHARE_PTR<NFIProperty> pOldProperty = this->GetElement(strProperty); if (!pOldProperty.get()) { NF_SHARE_PTR<NFIProperty> pNewProperty(NF_NEW NFCProperty(self, strProperty, pProperty->GetType(), pProperty->GetPublic(), pProperty->GetPrivate(), pProperty->GetSave(), pProperty->GetView(), pProperty->GetIndex(), pProperty->GetRelationValue())); this->AddElement(strProperty, pNewProperty); if (pProperty->GetIndex() > 0) { mxPropertyIndexMap.insert(std::map<std::string, int>::value_type(strProperty, pProperty->GetIndex())); } } return pOldProperty; }
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.get()) { 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->SetRelationValue(pProperty->GetRelationValue()); this->AddElement(strProperty, pNewProperty); } return pOldProperty; }