本文整理汇总了C++中ISecUser::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ ISecUser::clone方法的具体用法?C++ ISecUser::clone怎么用?C++ ISecUser::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISecUser
的用法示例。
在下文中一共展示了ISecUser::clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
void CPermissionsCache::add(ISecUser& sec_user)
{
if(!isCacheEnabled() || &sec_user == NULL)
return;
const char* username = sec_user.getName();
if(!username || !*username)
return;
synchronized block(m_userCacheMonitor);
CachedUser* user = m_userCache[username];
if(user)
{
m_userCache.erase(username);
delete user;
}
m_userCache[username] = new CachedUser(sec_user.clone());
}
示例2: add
void CPermissionsCache::add(ISecUser& sec_user)
{
if(!isCacheEnabled())
return;
const char* username = sec_user.getName();
if(!username || !*username)
return;
synchronized block(m_userCacheMonitor);
string key(username);
MapUserCache::iterator it = m_userCache.find(key);
CachedUser* user = NULL;
if (it != m_userCache.end())
{
user = (CachedUser*)(it->second);
m_userCache.erase(username);
delete user;
}
m_userCache[username] = new CachedUser(sec_user.clone());
}
示例3: add
void CPermissionsCache::add(ISecUser& sec_user)
{
if(!isCacheEnabled())
return;
const char* username = sec_user.getName();
if(!username || !*username)
return;
string key(username);
WriteLockBlock writeLock(m_userCacheRWLock );
MapUserCache::iterator it = m_userCache.find(key);
CachedUser* user = NULL;
if (it != m_userCache.end())
{
user = (CachedUser*)(it->second);
m_userCache.erase(username);
delete user;
}
#ifdef _DEBUG
DBGLOG("CACHE: CPermissionsCache Adding cached user %s", username);
#endif
m_userCache[username] = new CachedUser(sec_user.clone());
}