当前位置: 首页>>代码示例>>C++>>正文


C++ Container::Count方法代码示例

本文整理汇总了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;
}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:60,代码来源:StatusReporterInterface.cpp


注:本文中的Container::Count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。