本文整理汇总了C++中NF_SHARE_PTR::Exists方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::Exists方法的具体用法?C++ NF_SHARE_PTR::Exists怎么用?C++ NF_SHARE_PTR::Exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::Exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateRole
bool NFCAccountRedisModule::CreateRole(const std::string & strAccount, const std::string & strRoleName, const NFGUID & id)
{
std::string strAccountKey = m_pCommonRedisModule->GetAccountCacheKey(strAccount);
NF_SHARE_PTR<NFINoSqlDriver> xNoSqlDriver = m_pNoSqlModule->GetDriverBySuit(strAccount);
if (xNoSqlDriver)
{
if (xNoSqlDriver->Exists(strAccountKey) && !xNoSqlDriver->Exists(strRoleName))
{
xNoSqlDriver->HSet(strAccountKey, NFrame::Player::Name(), strRoleName);
xNoSqlDriver->HSet(strAccountKey, NFrame::Player::ID(), id.ToString());
NF_SHARE_PTR<NFINoSqlDriver> xRoleNameNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (xRoleNameNoSqlDriver)
{
xRoleNameNoSqlDriver->HSet(strRoleName, NFrame::Player::ID(), id.ToString());
}
/*
std::vector<std::string> vKey;
std::vector<std::string> vValue;
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetPropertyCacheKey(id), vKey, vValue);
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetRecordCacheKey(id), vKey, vValue);
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetPropertyStorageKey(id), vKey, vValue);
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetRecordStorageKey(id), vKey, vValue);
*/
return true;
}
}
return false;
}
示例2: ExistRoleName
bool NFCAccountRedisModule::ExistRoleName(const std::string & strRoleName)
{
NF_SHARE_PTR<NFINoSqlDriver> xNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (xNoSqlDriver)
{
return xNoSqlDriver->Exists(strRoleName);
}
return false;
}
示例3: ExistAccount
bool NFCAccountRedisModule::ExistAccount(const std::string & strAccount)
{
std::string strAccountKey = m_pCommonRedisModule->GetAccountCacheKey(strAccount);
NF_SHARE_PTR<NFINoSqlDriver> xNoSqlDriver = m_pNoSqlModule->GetDriverBySuit(strAccount);
if (xNoSqlDriver)
{
return xNoSqlDriver->Exists(strAccountKey);
}
return false;
}
示例4: GetRoleInfo
bool NFCAccountRedisModule::GetRoleInfo(const std::string & strAccount, std::string & strRoleName, NFGUID & id)
{
std::string strAccountKey = m_pCommonRedisModule->GetAccountCacheKey(strAccount);
NF_SHARE_PTR<NFINoSqlDriver> xNoSqlDriver = m_pNoSqlModule->GetDriverBySuit(strAccount);
if (xNoSqlDriver)
{
if (xNoSqlDriver->Exists(strAccountKey))
{
std::string strID;
bool bRoleNameRet = xNoSqlDriver->HGet(strAccountKey, NFrame::Player::Name(), strRoleName);
bool bRoleIDRet = xNoSqlDriver->HGet(strAccountKey, NFrame::Player::ID(), strID);
if (bRoleNameRet && bRoleIDRet
&& !strRoleName .empty() && !strID.empty())
{
return id.FromString(strID);
}
return false;
}
}
return false;
}