本文整理汇总了C++中UMLClassifierList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifierList::append方法的具体用法?C++ UMLClassifierList::append怎么用?C++ UMLClassifierList::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifierList
的用法示例。
在下文中一共展示了UMLClassifierList::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateCode
/**
* Slot for the generate button. Starts the code generation.
*/
void CodeGenStatusPage::generateCode()
{
ui_pushButtonGenerate->setEnabled(false);
setCommitPage(true); //:TODO: disable back and cancel button ?
CodeGenerator* codeGenerator = UMLApp::app()->generator();
UMLDoc* doc = UMLApp::app()->document();
if (codeGenerator) {
connect(codeGenerator, SIGNAL(codeGenerated(UMLClassifier*,bool)),
this, SLOT(classGenerated(UMLClassifier*,bool)));
connect(codeGenerator, SIGNAL(showGeneratedFile(QString)),
this, SLOT(showFileGenerated(QString)));
UMLClassifierList cList;
for (int row = 0; row < ui_tableWidgetStatus->rowCount(); ++row) {
QTableWidgetItem* item = ui_tableWidgetStatus->item(row, 0);
UMLClassifier *concept = doc->findUMLClassifier(item->text());
if (concept == NULL) {
uError() << "Could not find classifier " << item->text()
<< " - not included in generated code.";
continue;
}
cList.append(concept);
}
codeGenerator->writeCodeToFile(cList);
m_generationDone = true;
setFinalPage(true);
emit completeChanged();
}
}
示例2: findAssocClassifierObjsInRoles
UMLClassifierList ClassifierInfo::findAssocClassifierObjsInRoles (UMLAssociationList * list)
{
UMLClassifierList classifiers;
for (UMLAssociation *a = list->first(); a; a = list->next()) {
// DONT accept a classifier IF the association role is empty, by
// convention, that means to ignore the classifier on that end of
// the association.
// We also ignore classifiers which are the same as the current one
// (e.g. id matches), we only want the "other" classifiers
if (a->getObjectId(Uml::A) == classifier_->getID() && !a->getRoleName(Uml::B).isEmpty()) {
UMLClassifier *c = dynamic_cast<UMLClassifier*>(a->getObject(Uml::B));
if(c)
classifiers.append(c);
} else if (a->getObjectId(Uml::B) == classifier_->getID() && !a->getRoleName(Uml::A).isEmpty()) {
UMLClassifier *c = dynamic_cast<UMLClassifier*>(a->getObject(Uml::A));
if(c)
classifiers.append(c);
}
}
return classifiers;
}
示例3: setTemplateParams
void UMLAttribute::setTemplateParams(const QString& templateParam, UMLClassifierList &templateParamList) {
if (templateParam.isEmpty())
return;
QString type = templateParam.simplifyWhiteSpace();
int start = type.find(QChar('<'));
if (start >= 0 ) {
int end = start;
int count = 1;
int len = type.length();
while (count != 0 && ++end < len) {
QChar c = type.at(end);
if (c == QChar('<')) {
count++;
}
if (c == QChar('>')) {
count--;
}
}
if (count != 0) {
//The template is ill-formated, let's quit
return;
}
setTemplateParams(type.mid(start + 1, end - start - 1), templateParamList);
setTemplateParams(type.left(start) + type.right(len - end - 1), templateParamList);
} else {
QStringList paramsList = QStringList::split(QChar(','), type);
for ( QStringList::Iterator it = paramsList.begin(); it != paramsList.end(); ++it ) {
QString param = *it;
if (!param.isEmpty()) {
UMLDoc *pDoc = UMLApp::app()->getDocument();
UMLObject* obj = pDoc->findUMLObject(param);
if (obj == NULL ) {
obj = pDoc->findUMLObject(param.remove(QChar(' ')));
}
if (obj != NULL ) {
//We want to list only the params that already exist in this document
//If the param doesnt't already exist, we couldn't draw an association anyway
UMLClassifier* tmpClassifier = static_cast<UMLClassifier*>(obj);
if (templateParamList.findRef(tmpClassifier) == -1) {
templateParamList.append(tmpClassifier);
}
}
}
}
}
}