本文整理汇总了C++中Constraint::expression方法的典型用法代码示例。如果您正苦于以下问题:C++ Constraint::expression方法的具体用法?C++ Constraint::expression怎么用?C++ Constraint::expression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constraint
的用法示例。
在下文中一共展示了Constraint::expression方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateDesertConstraintSet
bool CreateDesertConstraintSet(ConstraintSet &cs, UdmDesertMap &des_map, DesertUdmMap &inv_des_map )
{
bool ret = true;
Constraint ct;
Element owner;
long cts_id;
set<Constraint> ct_set = cs.Constraint_children();
set<Constraint>::iterator ct_iterator;
ASSERT(!ct_set.empty());
//create constraint set
cts_id = CreateConstraintSet(utf82cstring((string)cs.name()));
DoMap(cs, des_map, inv_des_map, cts_id);
for(ct_iterator = ct_set.begin(); ct_iterator != ct_set.end(); ct_iterator++)
{
//get owner element
ct = *(ct_iterator);
owner = ct.context();
std::string aa = owner.name();
//lookup in the map
long owner_id = GetID(owner, des_map);
//create constraint
long ct_id = CreateConstraint(utf82cstring((string)ct.name()),
cts_id,
owner_id,
utf82cstring((string)ct.expression()));
/*
long ct_id = CreateConstraint(((string)ct.name()).c_str(),
cts_id,
owner_id,
((string)ct.expression()).c_str(),
ct.id(),
ct.externalID());
*/
if(ct_id==-1) ret = false;
DoMap(ct, des_map, inv_des_map, ct_id);
}//eo for (ct_iterator)
return ret;
};//eo bool CreateDesertConstrainSet