本文整理汇总了C++中Group::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::AddRef方法的具体用法?C++ Group::AddRef怎么用?C++ Group::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::AddRef方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeGroup
bool GroupManager::removeGroup( String &name )
{
boost::mutex::scoped_lock lock( guard );
FRL_EXCEPT_GUARD();
GroupElemNamesMap::iterator name_it = names_map.find( name );
if( name_it == names_map.end() )
FRL_THROW_S_CLASS( NotExistGroup );
name_it->second->isDeleted( True );
OPCHANDLE tmp_handle = name_it->second->getServerHandle();
names_map.erase( name_it );
GroupElemHandlesMap::iterator handle_it = handles_map.find( tmp_handle );
if( handle_it == handles_map.end() )
FRL_THROW_S_CLASS( NotExistGroup );
Group *ptr = handle_it->second.get();
ptr->AddRef();
handles_map.erase( handle_it );
return ptr->Release() == 0;
}
示例2: Next
STDMETHODIMP EnumGroup::Next( ULONG celt, IUnknown** rgelt, ULONG* pceltFetched )
{
if( pceltFetched )
{
*pceltFetched = 0;
}
if( rgelt == NULL || ( celt != 1 && pceltFetched == NULL) )
{
return E_POINTER;
}
if( currentIndex >= groupList.size() )
return S_FALSE;
Group *pGroup;
size_t i = currentIndex;
size_t j = 0;
for( ; i < groupList.size() && j < celt; ++i, ++j )
{
pGroup = groupList[i].get();
rgelt[j] = reinterpret_cast< IUnknown*>( pGroup );
if( pGroup != NULL )
pGroup->AddRef();
if( pceltFetched )
++(*pceltFetched);
}
if( j < celt )
{
currentIndex = groupList.size();
return S_FALSE;
}
currentIndex = i;
return S_OK;
}