本文整理汇总了C++中NF_SHARE_PTR::HMGET方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::HMGET方法的具体用法?C++ NF_SHARE_PTR::HMGET怎么用?C++ NF_SHARE_PTR::HMGET使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::HMGET方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGridBaseInfo
bool NFCBigMapRedisModule::GetGridBaseInfo(const std::vector<std::string>& strGridID, std::vector<NFMsg::BigMapGridBaseInfo>& xBaseInfoList)
{
NF_SHARE_PTR<NFIRedisClient> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (pNoSqlDriver)
{
std::vector<std::string> vValues;
std::string strKey = GetGridBaseKey();
std::string strData;
if (pNoSqlDriver->HMGET(strKey, strGridID, vValues))
{
for (int i = 0; i < vValues.size(); ++i)
{
const std::string& strData = vValues[i];
NFMsg::BigMapGridBaseInfo xBaseInfo;
if (xBaseInfo.ParseFromString(strData))
{
xBaseInfoList.push_back(xBaseInfo);
}
}
return true;
}
}
return false;
}
示例2: 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;
}
示例3: 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;
}