本文整理汇总了C++中ObjectRef::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectRef::GetName方法的具体用法?C++ ObjectRef::GetName怎么用?C++ ObjectRef::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectRef
的用法示例。
在下文中一共展示了ObjectRef::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpComponentGraph
void ComponentModelRegistry::dumpComponentGraph(ostream& os, bool display_nodeprops, bool display_linkprops)
{
renameObjects();
os << "# Microgrid system topology, generated by " << PACKAGE_NAME << " " << PACKAGE_VERSION << endl
<< "digraph Microgrid {" << endl
<< "overlap=\"false\"; labeljust=\"l\"; concentrate=\"true\"; splines=\"true\"; node [shape=box]; edge [len=2,constraint=\"false\"];" << endl;
for (auto& i : m_objects)
{
ObjectRef objref = i.first;
os << *m_names[objref] << " [label=\"" << *m_names[objref];
string name = objref->GetName();
if (name != *m_names[objref])
os << "\\nconfig:" << name;
if (display_nodeprops && !m_objprops[objref].empty())
{
for (auto& p : m_objprops[objref])
{
os << "\\n" << *p.first;
if (p.second->type != Entity::VOID)
{
os << ':';
printEntity(os, *p.second);
}
}
}
os << "\"];" << endl;
}
for (auto& i : m_linkprops)
{
auto& endpoints = i.first;
auto& props = i.second;
os << *m_names[endpoints.first] << " -> " << *m_names[endpoints.second.first]
<< " [constraint=\"" << (endpoints.second.second.first ? "false" : "true") << "\"";
if (endpoints.second.second.second)
os << ",dir=both";
if (display_linkprops)
{
os << ",label=\"";
for (auto& p : props)
{
os << *p.first;
if (p.second->type != Entity::VOID)
{
os << ':';
printEntity(os, *p.second);
}
os << ' ';
}
os << "\"";
}
os << "];" << endl;
}
os << "}" << endl;
}