本文整理汇总了C++中Subsystem::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Subsystem::add方法的具体用法?C++ Subsystem::add怎么用?C++ Subsystem::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subsystem
的用法示例。
在下文中一共展示了Subsystem::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_pair
//.........这里部分代码省略.........
kill_subthreads_and_exit();
}
for (auto& pLUN : availableTestLUNs.LUNpointers) pLUN -> createNicknames();
// Now we create the Subsystem objects
for (auto& pLUN : availableTestLUNs.LUNpointers)
{
std::string serial_number = pLUN->attribute_value(std::string("serial_number"));
trim(serial_number);
Subsystem* pSubsystem;
auto subsystemIt = subsystems.find(serial_number);
if (subsystems.end() == subsystemIt)
{
std::string product = pLUN->attribute_value("product");
trim(product);
if (0 == product.compare(std::string("OPEN-V")))
{
pSubsystem = new Hitachi_RAID_subsystem(serial_number, pLUN);
}
else
{
pSubsystem = new Subsystem(serial_number);
}
subsystems[serial_number] = pSubsystem;
}
else
{
pSubsystem = (*subsystemIt).second;
}
pSubsystem->add(pLUN);
}
// For each subsystem that the available test LUNs map to,
// for the first available real-time interface,
// start up the appropriate subthread to drive that interface.
// Which means - for each Hitachi RAID subsystem, use the first command device
// in commandDeviceLUNs that leads to that subsystem and start an
// pipe_driver_subthread, which fires up the ivy_cmddev executable remotely via ssh
// communicating via stdin/stdout pipes the same way we communicate with remote ivydriver instances.
for (auto& pear : subsystems)
{
Subsystem* pSubsystem = pear.second;
if (0 == std::string("Hitachi RAID").compare(pSubsystem->type()))
{
Hitachi_RAID_subsystem* pRAIDsubsystem {(Hitachi_RAID_subsystem*) pSubsystem};
bool have_cmd_dev_this_subsystem = false;
if (m_s.use_command_device) for (auto& pL : commandDeviceLUNs.LUNpointers)
// for each command device LUN as candidate to match as first command device for this subsystem.
{
if (0 == pSubsystem->serial_number.compare(pL->attribute_value("serial_number")))
// we have found the first command device for this subsystem
{
// fire up command device thread
std::string cmd_dev_description;
{
std::ostringstream o;