本文整理汇总了C++中CNode::get_children_writable方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::get_children_writable方法的具体用法?C++ CNode::get_children_writable怎么用?C++ CNode::get_children_writable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::get_children_writable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
node_map &CServer::get_sibling_set_writable( CNode &node )
{
CNode *parent = node.get_parent_writable();
if( parent )
{
return parent->get_children_writable();
}
else
{
return m_nodes;
}
}
示例2: add
void CStateTable::add( CNode &node )
{
/* add self to path map */
const string &path = node.get_path();
if( m_nodes.count( path ) > 0 )
{
INTEGRA_TRACE_ERROR << "duplicate key in state table: " << path;
}
else
{
m_nodes[ path ] = &node;
}
/* add self to id map */
internal_id id = node.get_id();
if( m_nodes_by_id.count( id ) > 0 )
{
INTEGRA_TRACE_ERROR << "duplicate key in state table: " << id;
}
else
{
m_nodes_by_id[ id ] = &node;
}
/* add node endpoints */
node_endpoint_map node_endpoints = node.get_node_endpoints_writable();
for( node_endpoint_map::const_iterator i = node_endpoints.begin(); i != node_endpoints.end(); i++ )
{
INodeEndpoint *node_endpoint = i->second;
const string &path = node_endpoint->get_path();
if( m_node_endpoints.count( path ) > 0 )
{
INTEGRA_TRACE_ERROR << "duplicate key in state table: " << path;
}
else
{
m_node_endpoints[ path ] = node_endpoint;
}
}
/* add child nodes */
node_map &children = node.get_children_writable();
for( node_map::iterator i = children.begin(); i != children.end(); i++ )
{
add( *CNode::downcast_writable( i->second ) );
}
}