本文整理汇总了C++中Relation::attribute方法的典型用法代码示例。如果您正苦于以下问题:C++ Relation::attribute方法的具体用法?C++ Relation::attribute怎么用?C++ Relation::attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relation
的用法示例。
在下文中一共展示了Relation::attribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: declare_relation
void BulkData::declare_relation( Entity & e_from ,
Entity & e_to ,
const unsigned identifier ,
const unsigned kind )
{
static const char method[] = "phdmesh::BulkData::declare_relation" ;
if ( in_closure( e_to , e_from ) ) {
std::ostringstream msg ;
print_declare_relation( msg , method , e_from , e_to , identifier , kind );
msg << " FAILED DUE TO CIRCULAR CLOSURE." ;
throw std::runtime_error( msg.str() );
}
{
const Relation forward( e_to , identifier , kind , false );
const std::vector<Relation>::iterator e = e_from.m_relation.end();
std::vector<Relation>::iterator i = e_from.m_relation.begin();
i = std::lower_bound( i , e , forward , LessRelation() );
if ( e == i || forward != *i ) { // Not a duplicate
if ( e != i && forward.attribute() == i->attribute() ) {
std::ostringstream msg ;
print_declare_relation( msg, method, e_from, e_to, identifier, kind );
msg << " FAILED, ALREADY HAS THIS RELATION TO " ;
print_entity_key( msg , i->entity()->key() );
throw std::runtime_error(msg.str());
}
e_from.m_relation.insert( i , forward );
}
}
{
const Relation converse( e_from , identifier , kind , true );
const std::vector<Relation>::iterator e = e_to.m_relation.end();
std::vector<Relation>::iterator i = e_to.m_relation.begin();
i = std::lower_bound( i , e , converse , LessRelation() );
if ( e == i || converse != *i ) { // Not a duplicate
e_to.m_relation.insert( i , converse );
}
}
{
PartSet add , del ;
deduce_part_relations( e_from , e_to , identifier , kind , add );
internal_change_entity_parts( e_to , add , del );
}
set_field_relations( e_from , e_to , identifier , kind );
}