本文整理汇总了C++中scxcorelib::SCXHandle::FindLVInfoByID方法的典型用法代码示例。如果您正苦于以下问题:C++ SCXHandle::FindLVInfoByID方法的具体用法?C++ SCXHandle::FindLVInfoByID怎么用?C++ SCXHandle::FindLVInfoByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scxcorelib::SCXHandle
的用法示例。
在下文中一共展示了SCXHandle::FindLVInfoByID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindLogicalDisks
/**
Discover logical disks.
Logical disks are identified by the /etc/mnttab file (by design). If ever
seen in that file, the disk will be discovered. If the disk is removed it
will be marked as offline.
*/
void StatisticalLogicalDiskEnumeration::FindLogicalDisks()
{
for (EntityIterator iter=Begin(); iter!=End(); iter++)
{
SCXCoreLib::SCXHandle<StatisticalLogicalDiskInstance> disk = *iter;
disk->m_online = false;
}
m_deps->RefreshMNTTab();
for (std::vector<MntTabEntry>::const_iterator it = m_deps->GetMNTTab().begin();
it != m_deps->GetMNTTab().end(); it++)
{
if ( ! m_deps->FileSystemIgnored(it->fileSystem) && ! m_deps->DeviceIgnored(it->device))
{
SCXCoreLib::SCXHandle<StatisticalLogicalDiskInstance> disk = FindDiskByDevice(it->device);
if (0 == disk)
{
disk = new StatisticalLogicalDiskInstance(m_deps);
disk->m_device = it->device;
disk->m_mountPoint = it->mountPoint;
disk->m_fsType = it->fileSystem;
disk->SetId(disk->m_mountPoint);
#if defined(linux)
static SCXLVMUtils lvmUtils;
if (lvmUtils.IsDMDevice(it->device))
{
try
{
// Try to convert the potential LVM device path into its matching
// device mapper (dm) device path.
std::wstring dmDevice = lvmUtils.GetDMDevice(it->device);
SCXASSERT(!dmDevice.empty());
disk->m_samplerDevices.push_back(dmDevice);
}
catch (SCXCoreLib::SCXException& e)
{
static SCXCoreLib::LogSuppressor suppressor(SCXCoreLib::eWarning, SCXCoreLib::eTrace);
std::wstringstream out;
out << L"An exception occurred resolving the dm device that represents the LVM partition " << it->device
<< L" : " << e.What();
SCX_LOG(m_log, suppressor.GetSeverity(out.str()), out.str());
}
}
// no else required; device was not an LVM device
#endif
AddInstance(disk);
#if defined(hpux)
if (m_pathToRdev.end() == m_pathToRdev.find(disk->m_device))
{
SCXCoreLib::SCXFilePath fp(disk->m_device);
fp.SetFilename(L"");
UpdatePathToRdev(fp.Get());
}
SCXASSERT(m_pathToRdev.end() != m_pathToRdev.find(disk->m_device));
m_deps->AddDeviceInstance(disk->m_device, L"", disk->FindLVInfoByID(m_pathToRdev.find(disk->m_device)->second), m_pathToRdev.find(disk->m_device)->second);
#endif
}
disk->m_online = true;
}
}
}