本文整理汇总了C++中UmlClass::set_Constraint方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlClass::set_Constraint方法的具体用法?C++ UmlClass::set_Constraint怎么用?C++ UmlClass::set_Constraint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlClass
的用法示例。
在下文中一共展示了UmlClass::set_Constraint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importIt
void UmlClass::importIt(FileIn & in, Token & token, UmlItem * where)
{
where = where->container(aClass, token, in); // can't be null
WrapperStr s = token.valueOf("name");
if (s.isEmpty()) {
static unsigned n = 0;
s.sprintf("anonymous_%u", ++n);
}
else
s = legalName(s);
UmlClass * cl = create(where, s);
Association * assocclass = 0;
bool stereotype = FALSE;
if (cl == 0)
in.error("cannot create classe '" + s +
"' in '" + where->name() + "'");
cl->addItem(token.xmiId(), in);
do
where = where->parent();
while (where->kind() != aPackage);
if (where->stereotype() == "profile")
cl->set_PropertyValue("xmiId", token.xmiId());
if (token.xmiType() == "uml:Actor")
cl->set_Stereotype("actor");
else if (token.xmiType() == "uml:Interface")
cl->set_Stereotype("interface");
else if (token.xmiType() == "uml:Enumeration")
cl->set_Stereotype("enum");
else if (token.xmiType() == "uml:Stereotype") {
cl->set_Stereotype("stereotype");
NumberOf -= 1;
NumberOfStereotype += 1;
stereotype = TRUE;
}
else if (token.xmiType() == "uml:AssociationClass") {
assocclass = &Association::get(token.xmiId(), token.valueOf("name"));
assocclass->set_class_association();
}
cl->setVisibility(token.valueOf("visibility"));
if (token.valueOf("isabstract") == "true")
cl->set_isAbstract(TRUE);
if (token.valueOf("isactive") == "true")
cl->set_isActive(TRUE);
if (! token.closed()) {
WrapperStr k = token.what();
const char * kstr = k;
WrapperStr assocclass_ref1;
WrapperStr assocclass_ref2;
while (in.read(), !token.close(kstr)) {
s = token.what();
if ((s == "ownedtemplatesignature") &&
((token.xmiType() == "uml:TemplateSignature") ||
(token.xmiType() == "uml:RedefinableTemplateSignature")))
cl->readFormal(in, token);
else if ((s == "templatebinding") &&
(token.xmiType() == "uml:TemplateBinding")) {
Binding::import(in, token, cl);
}
else if ((assocclass != 0) && (s == "memberend")) {
if (assocclass_ref1.isEmpty())
assocclass_ref1 = token.xmiIdref();
else
assocclass_ref2 = token.xmiIdref();
if (! token.closed())
in.finish(s);
}
else if ((assocclass != 0) &&
(s == "ownedend") &&
(token.xmiType() == "uml:Property"))
assocclass->import(in, token);
else if (s == "ownedrule")
cl->set_Constraint(UmlItem::readConstraint(in, token));
else if (stereotype &&
(s == "icon") &&
(token.xmiType() == "uml:Image")) {
WrapperStr path = token.valueOf("location");
if (! path.isEmpty())
cl->set_PropertyValue("stereotypeIconPath", path);
if (! token.closed())
in.finish(s);
}
//.........这里部分代码省略.........