本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
//.........这里部分代码省略.........