本文整理汇总了C++中Container::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::Count方法的具体用法?C++ Container::Count怎么用?C++ Container::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
StatusReporterInterface::ApplyNecessaryStatusRollupRules( ManagedObject *pObject,
const Container &children,
const Container &parents ){
ManagedObject *pParent, *pChild;
U32 index;
int newState, oldState;
bool canChangeFlag = true;
// first check parents
newState = SSAPI_OBJECT_STATE_UNKNOWN;
for( index = 0; index < parents.Count(); index++ ){
if ( pObject->GetParent( index ) == NULL )
pObject= pObject;
pParent = pObject->GetParent( index );
pParent->BuildYourValueSet();
pParent->GetInt( SSAPI_OBJECT_FID_STATE, &oldState );
pParent->Clear();
if( (oldState == SSAPI_OBJECT_STATE_DEAD) || (oldState == CTS_SSAPI_OBJECT_STATE_NAME_UNKNOWN) ){
if( newState != m_state ){
m_state = newState;
m_stateString = CTS_SSAPI_OBJECT_STATE_NAME_UNKNOWN;
m_isRolledUp = true;
return true;
}
else
canChangeFlag = false;
}
}
// second, check children
newState = SSAPI_OBJECT_STATE_WARNING;
for( index = 0; index < children.Count(); index++ ) {
pChild = pObject->GetChild( index );
pChild->BuildYourValueSet();
pChild->GetInt( SSAPI_OBJECT_FID_STATE, &oldState );
pChild->Clear();
if( oldState != SSAPI_OBJECT_STATE_GOOD ){
if( (m_state != newState) && (m_state == SSAPI_OBJECT_STATE_GOOD) ){
m_state = newState;
m_stateString = CTS_SSAPI_OBJECT_STATE_NAME_WARNING;
m_isRolledUp = true;
return true;
}
else
canChangeFlag = false;
}
}
if( canChangeFlag && m_isRolledUp ){
m_isRolledUp = false;
m_state = SSAPI_OBJECT_STATE_GOOD;
m_stateString= CTS_SSAPI_OBJECT_STATE_NAME_GOOD;
return true;
}
return false;
}