本文整理汇总了C++中Output::addOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ Output::addOwner方法的具体用法?C++ Output::addOwner怎么用?C++ Output::addOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::addOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateIOComponentModules
//.........这里部分代码省略.........
error_messages.push_back(error_buf);
++num_errors;
continue; // could not find this device
}
EntryDetails *ed = &module->entry_details[entry_position];
unsigned int direction = module->syncs[ed->sm_index].dir;
unsigned int offset_idx = entry_position;
unsigned int bitlen = module->pdo_entries[entry_position].bit_length;
if (direction == EC_DIR_OUTPUT)
{
#if 0
std::cerr << "Adding new output device " << m->getName()
<< " position: " << entry_position
<< " name: " << module->entry_details[offset_idx].name
<< " bit_pos: " << module->bit_positions[offset_idx]
<< " offset: " << module->offsets[offset_idx]
<< " bitlen: " << bitlen << "\n";
#endif
IOAddress addr (
IOComponent::add_io_entry(ed->name.c_str(),
module_position,
module->offsets[offset_idx],
module->bit_positions[offset_idx], offset_idx, bitlen));
if (bitlen == 1)
{
Output *o = new Output(addr);
output_list.push_back(o);
IOComponent::devices[m->getName().c_str()] = o;
o->setName(m->getName().c_str());
m->io_interface = o;
o->addDependent(m);
o->addOwner(m);
}
else
{
AnalogueOutput *o = new AnalogueOutput(addr);
output_list.push_back(o);
IOComponent::devices[m->getName().c_str()] = o;
o->setName(m->getName().c_str());
m->io_interface = o;
o->addDependent(m);
o->addOwner(m);
o->setupProperties(m);
}
}
else
{
//sstr << m->getName() << "_IN_" << entry_position << std::flush;
//const char *name_str = sstr.str().c_str();
#if 1
std::cerr << "Adding new input device " << m->getName()
<< " position: " << entry_position
<< " name: " << module->entry_details[offset_idx].name
<< " sm_idx: " << std::hex << ed->sm_index << std::dec
<< " bit_pos: " << module->bit_positions[offset_idx]
<< " offset: " << module->offsets[offset_idx]
<< " bitlen: " << bitlen << "\n";
#endif
IOAddress addr( IOComponent::add_io_entry(ed->name.c_str(),
module_position,
module->offsets[offset_idx],
module->bit_positions[offset_idx], offset_idx, bitlen));
if (bitlen == 1)