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


C++ DeviceList::count方法代码示例

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


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

示例1: onDeviceChange

void LeapHands::onDeviceChange(const Controller& controller) {
	std::cout << "Device Changed" << std::endl;
	const DeviceList devices = controller.devices();

	for (int i = 0; i < devices.count(); ++i) {
		std::cout << "id: " << devices[i].toString() << std::endl;
		std::cout << "  isStreaming: " << (devices[i].isStreaming() ? "true" : "false") << std::endl;
	}
}
开发者ID:AdamCarrick,项目名称:BGE,代码行数:9,代码来源:LeapHands.cpp

示例2: cDebug

void
PartitionCoreModule::doInit()
{
    FileSystemFactory::init();

    using DeviceList = QList< Device* >;

    CoreBackend* backend = CoreBackendManager::self()->backend();
    DeviceList devices = backend->scanDevices( true );

    cDebug() << "Winnowing" << devices.count() << "devices.";

    // Remove the device which contains / from the list
    for ( DeviceList::iterator it = devices.begin(); it != devices.end(); )
        if ( ! (*it) || hasRootPartition( *it ) ||
             (*it)->deviceNode().startsWith( "/dev/zram") ||
             isIso9660( *it ) )
        {
            cDebug() << "  .. Winnowing" << ( (*it) ? (*it)->deviceNode() : QString( "<null device>" ) );
            it = devices.erase( it );
        }
        else
            ++it;

    cDebug() << "LIST OF DETECTED DEVICES:";
    cDebug() << "node\tcapacity\tname\tprettyName";
    for ( auto device : devices )
    {
        auto deviceInfo = new DeviceInfo( device );
        m_deviceInfos << deviceInfo;
        cDebug() << device->deviceNode() << device->capacity() << device->name() << device->prettyName();
    }
    cDebug() << ".." << devices.count() << "devices detected.";
    m_deviceModel->init( devices );

    // The following PartUtils::runOsprober call in turn calls PartUtils::canBeResized,
    // which relies on a working DeviceModel.
    m_osproberLines = PartUtils::runOsprober( this );

    // We perform a best effort of filling out filesystem UUIDs in m_osproberLines
    // because we will need them later on in PartitionModel if partition paths
    // change.
    // It is a known fact that /dev/sda1-style device paths aren't persistent
    // across reboots (and this doesn't affect us), but partition numbers can also
    // change at runtime against our will just for shits and giggles.
    // But why would that ever happen? What system could possibly be so poorly
    // designed that it requires a partition path rearrangement at runtime?
    // Logical partitions on an MSDOS disklabel of course.
    // See DeletePartitionJob::updatePreview.
    for ( auto deviceInfo : m_deviceInfos )
    {
        for ( auto it = PartitionIterator::begin( deviceInfo->device.data() );
              it != PartitionIterator::end( deviceInfo->device.data() ); ++it )
        {
            Partition* partition = *it;
            for ( auto jt = m_osproberLines.begin();
                  jt != m_osproberLines.end(); ++jt )
            {
                if ( jt->path == partition->partitionPath() &&
                     partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone &&
                     !partition->fileSystem().uuid().isEmpty() )
                {
                    jt->uuid = partition->fileSystem().uuid();
                }
            }
        }
    }

    for ( auto deviceInfo : m_deviceInfos )
    {
        deviceInfo->partitionModel->init( deviceInfo->device.data(), m_osproberLines );
    }

    m_bootLoaderModel->init( devices );

    if ( QDir( "/sys/firmware/efi/efivars" ).exists() )
        scanForEfiSystemPartitions(); //FIXME: this should be removed in favor of
                                      //       proper KPM support for EFI
}
开发者ID:shainer,项目名称:calamares,代码行数:79,代码来源:PartitionCoreModule.cpp


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