本文整理汇总了C++中IdList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ IdList::append方法的具体用法?C++ IdList::append怎么用?C++ IdList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdList
的用法示例。
在下文中一共展示了IdList::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: elementsByPropertyContent
qReal::IdList Repository::elementsByPropertyContent(const QString &propertyValue, bool sensitivity
, bool regExpression) const
{
const Qt::CaseSensitivity caseSensitivity = sensitivity ? Qt::CaseSensitive : Qt::CaseInsensitive;
const QRegExp regExp(propertyValue, caseSensitivity);
IdList result;
for (Object * const element : mObjects.values()) {
QMapIterator<QString, QVariant> iterator = element->propertiesIterator();
if (regExpression) {
while (iterator.hasNext()) {
if (iterator.next().value().toString().contains(regExp)) {
result.append(mObjects.key(element));
break;
}
}
} else {
while (iterator.hasNext()) {
if (iterator.next().value().toString().contains(propertyValue, caseSensitivity)) {
result.append(mObjects.key(element));
break;
}
}
}
}
return result;
}
示例2: elementsFromBlock
IdList RefactoringApplier::elementsFromBlock(QString const &blockType) const
{
IdList list;
IdList resultList;
IdList const refactoringElements = mRefactoringRepoApi->children(Id::rootId());
foreach (Id const &refactoringElement, refactoringElements) {
if (mRefactoringRepoApi->isGraphicalElement(refactoringElement)) {
if (refactoringElement.element() == "RefactoringDiagramNode") {
list = mRefactoringRepoApi->children(refactoringElement);
foreach (Id const &id, list) {
if (id.element() == blockType) {
resultList.append(mRefactoringRepoApi->children(id));
break;
}
}
foreach (Id const &id, list) {
if (id.element() == "Link" && resultList.contains(toInRule(id))
&& resultList.contains(fromInRule(id)))
{
resultList.append(id);
}
}
}
}
}
示例3: findElementsByName
IdList Repository::findElementsByName(const QString &name, bool sensitivity, bool regExpression) const
{
const Qt::CaseSensitivity caseSensitivity = sensitivity ? Qt::CaseSensitive : Qt::CaseInsensitive;
const QRegExp regExp(name, caseSensitivity);
IdList result;
if (regExpression){
for (Object * const element : mObjects.values()) {
if (element->property("name").toString().contains(regExp)
&& !isLogicalId(mObjects.key(element))) {
result.append(mObjects.key(element));
}
}
} else {
for (Object * const element : mObjects.values()) {
if (element->property("name").toString().contains(name, caseSensitivity)
&& !isLogicalId(mObjects.key(element))) {
result.append(mObjects.key(element));
}
}
}
return result;
}
示例4: IdList
/** @cond doxygenLibsbmlInternal */
IdList*
SBMLLevelVersionConverter::collectSpeciesReferenceIds()
{
IdList* srids = new IdList();
for (unsigned int i = 0; i < mDocument->getModel()->getNumReactions(); i++)
{
Reaction *r = mDocument->getModel()->getReaction(i);
for (unsigned int j = 0; j < r->getNumReactants(); j++)
{
if (r->getReactant(j)->isSetId())
{
srids->append(r->getReactant(j)->getId());
}
}
for (unsigned int j = 0; j < r->getNumProducts(); j++)
{
if (r->getProduct(j)->isSetId())
{
srids->append(r->getProduct(j)->getId());
}
}
}
return srids;
}
示例5: setItemsToDelete
void MultipleRemoveCommand::setItemsToDelete(IdList &itemsToDelete)
{
IdList itemsToUpdate;
addEdgesToBeDeleted(itemsToDelete);
// QGraphicsScene::selectedItems() returns items in no particular order,
// so we should handle parent-child relationships manually
while (!itemsToDelete.isEmpty()) {
const Id currentItem = itemsToDelete.at(0);
const IdList children = mGraphicalApi.children(currentItem);
foreach (const Id &child, children) {
itemsToDelete.removeAll(child);
// Child remove commands will be added in currentItem delete command
}
const bool isEdge = !mLogicalApi.editorManagerInterface().isGraphicalElementNode(currentItem);
if (isEdge) {
const Id src = mGraphicalApi.from(currentItem);
if (src != Id() && !itemsToUpdate.contains(src)) {
itemsToUpdate.append(src);
}
const Id dst = mGraphicalApi.to(currentItem);
if (dst != Id() && !itemsToUpdate.contains(dst)) {
itemsToUpdate.append(dst);
}
insertPreAction(graphicalDeleteCommand(currentItem), 0);
} else {
addPreAction(graphicalDeleteCommand(currentItem));
}
itemsToDelete.removeAll(currentItem);
}
示例6: idsOfAllChildrenOf
IdList Repository::idsOfAllChildrenOf(Id id) const
{
IdList result;
result.clear();
result.append(id);
IdList list = mObjects[id]->children();
for (const Id &childId : list) {
result.append(idsOfAllChildrenOf(childId));
}
return result;
}
示例7: graphicalIdsByLogicalId
IdList GraphicalModelAssistApi::graphicalIdsByLogicalId(Id const &logicalId) const
{
IdList result;
QList<QPersistentModelIndex> indexes = mGraphicalModel.indexesWithLogicalId(logicalId);
foreach (QPersistentModelIndex index, indexes) {
result.append(idByIndex(index));
}
示例8: generateToJava
QString JavaHandler::generateToJava(QString const &pathToDir)
{
mErrorText = "";
this->pathToDir = pathToDir;
Id repoId = ROOT_ID;
if (checkTheModel()) {
IdList allDiagrams = mApi.children(repoId);
IdList classDiagrams;
//separate just class diagrams, because they are the main diagrams, others are connected
foreach (Id const aDiagram, allDiagrams) {
if (objectType(aDiagram) == "ClassDiagram_ClassDiagramNode") {
classDiagrams.append(aDiagram);
}
if (objectType(aDiagram) == "ActivityDiagram_ActivityDiagramNode") {
//If there is no connected Class Methods it won't be serialized
IdList incomingConnections = mApi.incomingConnections(aDiagram);
if (incomingConnections.isEmpty()) {
addError("Unable to serialize object " + objectType(aDiagram) + " with type: " + aDiagram.toString() + ". It is not connected to some class method.");
}
}
}
foreach (Id const classDiagram, classDiagrams) {
serializeChildren(classDiagram);
}
}
示例9: applyElementsTo
IdList RefactoringApplier::applyElementsTo()
{
IdList result;
for (int i = 0; i < mApply->size(); ++i) {
result.append(mApply->at(i).second);
}
return result;
}
示例10: graphicalIdsByLogicalId
IdList GraphicalModelAssistApi::graphicalIdsByLogicalId(const Id &logicalId) const
{
IdList result;
QList<QPersistentModelIndex> indexes = mGraphicalModel.indexesWithLogicalId(logicalId);
for (const QPersistentModelIndex &index : indexes) {
result.append(idByIndex(index));
}
return result;
}
示例11: allRules
IdList VisualInterpreterUnit::allRules() const
{
IdList const elements = elementsFromActiveDiagram();
IdList result;
foreach (Id const &element, elements) {
if (element.element() == "SemanticsRule") {
result.append(element);
}
}
return result;
}
示例12: subprogramElementId
Id RefactoringApplier::subprogramElementId() const
{
IdList result;
IdList const after = elementsFromAfterBlock();
for (Id const &id : after) {
if (mRefactoringRepoApi->isGraphicalElement(id)
&& (isNodeInRule(id)))
result.append(id);
}
if (result.size() == 1)
return result.first();
return Id::rootId();
}
示例13: diagramsFromList
IdList LogicalModelAssistApi::diagramsFromList(IdList const &list) const
{
// TODO: diagrams are kinda special, so we need the editor to be able to
// tell us whether this particular element is a diagram or not
IdList result;
foreach (Id type, list) {
if (type.element().split("_").back().contains("Diagram", Qt::CaseInsensitive)) {
if (!result.contains(type))
result.append(type);
}
}
return result;
}
示例14: elementsByProperty
qReal::IdList Repository::elementsByProperty(const QString &property, bool sensitivity
, bool regExpression) const
{
IdList result;
for (Object *element : mObjects.values()) {
if ((element->hasProperty(property, sensitivity, regExpression))
&& (!isLogicalId(mObjects.key(element)))) {
result.append(mObjects.key(element));
}
}
return result;
}
示例15: logCycle
void
FunctionDefinitionRecursion::determineCycles(const Model& m)
{
IdIter it;
IdRange range;
IdList variables;
IdMap logged;
std::string id;
variables.clear();
/* create a list of variables that are cycles ie (x, x) */
for (it = mIdMap.begin(); it != mIdMap.end(); it++)
{
if ((*it).first == (*it).second)
{
id = (*it).first;
if (!variables.contains(id))
{
variables.append(id);
}
}
}
/* loop thru other dependencies for each; if the dependent is also
* in the list then this is the cycle
* keep a record of logged dependencies to avoid logging twice
*/
for (unsigned int n = 0; n < variables.size(); n++)
{
id = variables.at((int)n);
range = mIdMap.equal_range(id);
for (it = range.first; it != range.second; it++)
{
if (((*it).second != id)
&& (variables.contains((*it).second))
&& !alreadyExistsInMap(logged,
pair<const std::string, std::string>(id, (*it).second))
&& !alreadyExistsInMap(logged,
pair<const std::string, std::string>((*it).second, id)))
{
logCycle(m.getFunctionDefinition(id), m.getFunctionDefinition((*it).second));
logged.insert(pair<const std::string, std::string>(id, (*it).second));
}
}
}
}