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


C++ CDiskObjectList::push_back方法代码示例

本文整理汇总了C++中CDiskObjectList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ CDiskObjectList::push_back方法的具体用法?C++ CDiskObjectList::push_back怎么用?C++ CDiskObjectList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDiskObjectList的用法示例。


在下文中一共展示了CDiskObjectList::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UnBind

CDiskObjectList CLanUnitDiskObject::UnBind(CDiskObjectPtr _this)
{
	ATLASSERT( this == _this.get() );
	CDiskObjectList listUnbound;

	// If the disk is aggregated, the MBR block of the disk should be cleaned
	// to prevent unexpected behavior of disks after unbinding.
	CDataSector dataSector( SECTOR_MBR_COUNT );
	dataSector.SetLocation( 0 );
	if ( m_pHandler->IsBoundAndNotSingleMirrored() )
	{
		try{
			dataSector.WriteAccept( &m_session );
		}
		catch( CNDASException &e )
		{
			NDAS_THROW_EXCEPTION_CHAIN_STR(
				CDiskException,
				CDiskException::ERROR_FAIL_TO_INITIALIZE,
				_T("Fail to clean MBR"),
				e);
		}
	}

	// Clear bind information
	m_pHandler->UnBind(
		boost::dynamic_pointer_cast<CUnitDiskObject>(_this)
		);

	listUnbound.push_back(_this);
	return listUnbound;
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例2: GetDiskObjectList

CDiskObjectList CNBListViewCtrl::GetDiskObjectList()
{
	int nCount = CListViewCtrl::GetItemCount();
	CDiskObjectList diskList;
	for ( int i=0; i < nCount; i++ )
	{
		diskList.push_back( m_mapObject[CListViewCtrl::GetItemData(i)] );
	}
	return diskList;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例3: GetSelectedDiskObjectList

CDiskObjectList CNBListViewCtrl::GetSelectedDiskObjectList()
{
	int nCount = CListViewCtrl::GetSelectedCount();
	int nItem;
	CDiskObjectList selectDiskList;

	nItem = -1;
	for ( int i=0; i < nCount; i++ )
	{
		nItem = CListViewCtrl::GetNextItem( nItem, LVNI_SELECTED );
		selectDiskList.push_back( m_mapObject[CListViewCtrl::GetItemData(nItem)] );
	}

	return selectDiskList;
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例4: OnSynchronize

BOOL CMirDiskUIHandler::OnSynchronize(CDiskObjectPtr obj) const
{
	ATLASSERT( dynamic_cast<CMirDiskObject*>(obj.get()) != NULL );
	
	CMirDiskObjectPtr mirDisk = 
		boost::dynamic_pointer_cast<CMirDiskObject>(obj);
	CUnitDiskObjectPtr sourceDisk, destDisk;
	BOOL bFirstDefected, bSecondDefected;
	BOOL bResults;
	
	bResults = mirDisk->GetDirtyDiskStatus(&bFirstDefected, &bSecondDefected);
	if(!bResults)
		return FALSE;

	// check dirty status here
//	ATLASSERT( mirDisk->GetDirtyDiskCount() > 0 );
	if ( !bFirstDefected && !bSecondDefected)
	{
		WTL::CString strMsg;
		strMsg.LoadString(IDS_WARNING_NOT_NEED_RECOVER );
		WTL::CString strTitle;
		strTitle.LoadString(IDS_APPLICATION);
		MessageBox( 
			::GetFocus(),
			strMsg,
			strTitle,
			MB_OK | MB_ICONERROR
			);
		return TRUE;
	}
	
	//
	// Select the source disk and the dest disk
	//
	if ( bFirstDefected && bSecondDefected)
	{
		CSelectDiskDlg dlgSelect(IDD_SELSOURCE);
		CDiskObjectList listDisks;
		listDisks.push_back( mirDisk->front() );
		listDisks.push_back( mirDisk->back() );
		dlgSelect.SetSingleDisks( listDisks );
		if ( dlgSelect.DoModal() != IDOK )
			return TRUE;
		sourceDisk = dlgSelect.GetSelectedDisk();
		if ( sourceDisk == mirDisk->front() )
			destDisk = 
				boost::dynamic_pointer_cast<CUnitDiskObject>(mirDisk->back());
		else
			destDisk = 
				boost::dynamic_pointer_cast<CUnitDiskObject>(mirDisk->front());
	}
	else
	{
		if (bFirstDefected)
		{
			sourceDisk = 
				/*boost::dynamic_pointer_cast<CUnitDiskObject>*/ (mirDisk->SecondDisk());
			destDisk = 
			/*boost::dynamic_pointer_cast<CUnitDiskObject>*/ (mirDisk->FirstDisk());
		}
		else if (bSecondDefected )
		{
			sourceDisk = 
				/*boost::dynamic_pointer_cast<CUnitDiskObject>*/ (mirDisk->FirstDisk());
			destDisk = 
				/*boost::dynamic_pointer_cast<CUnitDiskObject>*/ (mirDisk->SecondDisk());
		}
		else
		{
			return FALSE;
		}
	}

	//
	// Synchronize
	//

	CRecoverDlg dlgRecover(FALSE, IDS_LOGDEV_TYPE_DISK_RAID1, IDS_RECOVERDLG_TASK_RECOVER);

	dlgRecover.SetMemberDevice(destDisk);
	dlgRecover.DoModal();

	CNdasHIXChangeNotify HixChangeNotify(pGetNdasHostGuid());
	bResults = HixChangeNotify.Initialize();
	if(bResults)
	{
		NDAS_UNITDEVICE_ID unitDeviceId;

		CopyMemory(unitDeviceId.DeviceId.Node,
			sourceDisk->GetLocation()->GetUnitDiskLocation()->MACAddr,
			sizeof(unitDeviceId.DeviceId.Node));
		unitDeviceId.UnitNo = 
			sourceDisk->GetLocation()->GetUnitDiskLocation()->UnitNumber;
		HixChangeNotify.Notify(unitDeviceId);

		CopyMemory(unitDeviceId.DeviceId.Node,
			destDisk->GetLocation()->GetUnitDiskLocation()->MACAddr,
			sizeof(unitDeviceId.DeviceId.Node));
		unitDeviceId.UnitNo = 
			destDisk->GetLocation()->GetUnitDiskLocation()->UnitNumber;
//.........这里部分代码省略.........
开发者ID:yzx65,项目名称:ndas4windows,代码行数:101,代码来源:nbuihandler.cpp


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