当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectList::append方法代码示例

本文整理汇总了C++中ObjectList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectList::append方法的具体用法?C++ ObjectList::append怎么用?C++ ObjectList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectList的用法示例。


在下文中一共展示了ObjectList::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

    ObjectList<AST_t> AST_t::children() const
    {
        ObjectList<AST_t> result;

        result.append(AST_t(ASTSon0(_ast)));
        result.append(AST_t(ASTSon1(_ast)));
        result.append(AST_t(ASTSon2(_ast)));
        result.append(AST_t(ASTSon3(_ast)));

        return result;
    }
开发者ID:sdruix,项目名称:AutomaticParallelization,代码行数:11,代码来源:tl-ast.cpp

示例2: compute_bounds_of_sectioned_expression

        static Expression compute_bounds_of_sectioned_expression(Expression expr, 
                ObjectList<Expression>& lower_bounds, ObjectList<Expression>& upper_bounds)
        {
            if (expr.is_array_section_range())
            {
                Expression result 
                    = compute_bounds_of_sectioned_expression(expr.array_section_item(), lower_bounds, upper_bounds);
                lower_bounds.append(expr.array_section_lower());
                upper_bounds.append(expr.array_section_upper());

                return result;
            }
            return expr;
        }
开发者ID:sdruix,项目名称:AutomaticParallelization,代码行数:14,代码来源:tl-adf.cpp

示例3: fill_guard_tasks_basic

        void fill_guard_tasks_basic(Statement stmt) 
        {
			struct IsOmpTask : public Predicate<AST_t>
			{
				ScopeLink _sl;
				IsOmpTask(ScopeLink sl)
					:_sl(sl)
					{
					}

				bool do_(IsOmpTask::ArgType a) const
				{
					return is_pragma_custom_construct("omp", "task", a, _sl);
				}
			};

            ObjectList<AST_t> tasks = stmt.get_ast().depth_subtrees(IsOmpTask(stmt.get_scope_link()));

            for (ObjectList<AST_t>::iterator it = tasks.begin();
                    it != tasks.end();
                    it++)
            {
                PragmaCustomConstruct task_construct(*it, stmt.get_scope_link());

                GuardedTask guarded_task(task_construct);
                _guarded_task_list.append(guarded_task);
                _num_tasks++;
            }
        }
开发者ID:bsc-pm,项目名称:mcxx,代码行数:29,代码来源:hlt-task-aggregation-common.hpp

示例4: objectStore

/** return a list of data objects where all dependencies appear earlier in the list */
ObjectList<DataObject> Document::sortedDataObjectList() {
  ObjectList<DataObject> sorted;
  ObjectList<DataObject> raw = objectStore()->getObjects<DataObject>();

  sorted.clear();


  // set the flag for all primitives: not strictly necessary
  // since it should have been done in the constructor, but...
  PrimitiveList all_primitives = objectStore()->getObjects<Primitive>();
  int n = all_primitives.size();
  for (int i=0; i<n; i++) {
    all_primitives[i]->setFlag(true);
  }

  // now unset the flags of all output primitives to indicate their parents haven't been
  // put in the sorted list yet
  n = raw.size();
  for (int i=0; i<n; i++) {
    raw[i]->setOutputFlags(false);
  }

  // now place into the sorted list all data objects whose inputs haven't got parents
  // or whose inputs have parents which are already in the sorted list.
  // do this at most n^2 times, which is worse than worse case.
  int i=0;
  while (!raw.isEmpty() && (++i <= n*n)) {
    DataObjectPtr D = raw.takeFirst();
    if (D->inputFlagsSet()) {
      D->setOutputFlags(true);
      sorted.append(D);
    } else {
      raw.append(D); // try again later
    }
  }

  if ((i== n*n) && (n>1)) {
    qDebug() << "Warning: loop detected, File will not be able to be loaded correctly!";
    while (!raw.isEmpty()) {
      DataObjectPtr D = raw.takeFirst();
      sorted.append(D);
    }
  }

  return sorted;
}
开发者ID:jmlee4301,项目名称:kst,代码行数:47,代码来源:document.cpp

示例5:

 ObjectList<MSAttribute> Symbol::get_ms_attributes() const
 {
     ObjectList<MSAttribute> result;
     for (int i = 0; i < _symbol->entity_specs.num_ms_attributes; i++)
     {
         result.append(_symbol->entity_specs.ms_attributes[i]);
     }
     return result;
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例6:

 ObjectList<Symbol> Symbol::get_related_symbols() const
 {
     ObjectList<Symbol> result;
     for (int i = 0; i < symbol_entity_specs_get_num_related_symbols(_symbol); i++)
     {
         result.append(symbol_entity_specs_get_related_symbols_num(_symbol, i));
     }
     return result;
 }
开发者ID:bsc-pm,项目名称:mcxx,代码行数:9,代码来源:tl-symbol.cpp

示例7: get_declaration_with_parameters

    std::string Type::get_declaration_with_parameters(Scope sc, const std::string& symbol_name,
            ObjectList<std::string>& parameters, ObjectList<std::string>& parameter_attributes, TypeDeclFlags flags) const
    {
        int num_parameters = this->parameters().size();

        const char** parameter_names  = new const char*[num_parameters + 1];
        const char** param_attributes = new const char*[num_parameters + 1];

        for (int i = 0; i < num_parameters; i++)
        {
            parameter_names[i] = NULL;
            param_attributes[i] = NULL;
        }

        int orig_size = parameters.size();
        for (int i = 0; i < orig_size; i++)
        {
            parameter_names[i] = uniquestr(parameters[i].c_str());
            param_attributes[i] = uniquestr(parameter_attributes[i].c_str());
        }

        const char* result = get_declaration_string(_type_info, sc._decl_context, symbol_name.c_str(),
                "", 0, num_parameters, parameter_names, param_attributes, flags == PARAMETER_DECLARATION);

        for (int i = 0; i < num_parameters; i++)
        {
            if (i < orig_size)
            {
                parameters[i] = parameter_names[i];
            }
            else
            {
                if (parameter_names[i] != NULL)
                    parameters.append(parameter_names[i]);
                else
                    parameters.append("");
            }
        }

        delete[] parameter_names;
        delete[] param_attributes;

        return result;
    }
开发者ID:frantgn90,项目名称:master,代码行数:44,代码来源:tl-type.cpp

示例8: updateVectorList

void ExportVectorsDialog::updateVectorList() {
  VectorList allVectors = _store->getObjects<Vector>();

  QStringList vectorNameList;

  ObjectList<Vector> vectors;

  foreach (VectorPtr P, allVectors) {
    vectors.append(P);
    vectorNameList.append(P->Name());
  }
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:11,代码来源:exportvectorsdialog.cpp

示例9: if

TL::ObjectList<TL::ForStatement> TL::HLT::get_all_sibling_for_statements(TL::Statement st)
{
    ObjectList<ForStatement> result;
    if (ForStatement::predicate(st.get_ast()))
    {
        result.append(ForStatement(st.get_ast(), st.get_scope_link()));
    }
    else if (st.is_compound_statement())
    {
        ObjectList<Statement> inner_stmt = st.get_inner_statements();
        for (ObjectList<Statement>::iterator it = inner_stmt.begin();
                it != inner_stmt.end();
                it++)
        {
            result.append(get_all_sibling_for_statements(*it));
        }
    }

    return result;
}
开发者ID:sdruix,项目名称:AutomaticParallelization,代码行数:20,代码来源:hlt-composition.cpp

示例10: getParamSymbols

/**
 *
 * @param param_symbols List of symbols inside the body
 * @param funct_scopeB  Body Scope
 */
void InlinePhase::getParamSymbols(ObjectList<Symbol> &param_symbols, Scope& funct_scopeB) {
    ObjectList<Symbol> possible_params = funct_scopeB.get_all_symbols(0);
    int j = 0;
    for (ObjectList<Symbol>::iterator itu = possible_params.begin();
            itu != possible_params.end();
            itu++, j++) {
        if (itu->is_parameter() == 1) {
            param_symbols.append(possible_params[j]);
        }
    }

}
开发者ID:yundantianchang,项目名称:AutomaticParallelization,代码行数:17,代码来源:inline_phase.cpp

示例11: find

        /*!
         * \param t The element to be matched
         * \return A new list with all the elements of the original one
         * that are equals (according to 'operator==' of T) to \a t
         *
         * This function requires 'operator==' be defined for the type T
         */
        ObjectList<T> find(const T& t) const
        {
            ObjectList<T> result;

            for (typename ObjectList<T>::const_iterator it = std::find(this->begin(), this->end(), t);
                    it != this->end();
                    it++)
            {
                result.append(*it);
            }

            return result;
        }
开发者ID:sdruix,项目名称:AutomaticParallelization,代码行数:20,代码来源:tl-objectlist.hpp

示例12:

    ObjectList<Symbol> Type::enum_get_enumerators()
    {
        ObjectList<Symbol> enumerators;

        int i;
        for (i = 0; i < enum_type_get_num_enumerators(this->_type_info); i++)
        {
            scope_entry_t* enumerator = enum_type_get_enumerator_num(this->_type_info, i);
            enumerators.append(enumerator);
        };

        return enumerators;
    }
开发者ID:frantgn90,项目名称:master,代码行数:13,代码来源:tl-type.cpp

示例13: do_blocking

TL::Source LoopBlocking::do_blocking()
{
    ObjectList<ForStatement> nest_loops = _for_nest_info.get_nest_list();

    _nesting = std::min(_nest_factors.size(), nest_loops.size());

    for (int current_nest = _nesting - 1;
            current_nest >= 0;
            current_nest--)
    {
        ForStatement& for_statement = nest_loops[current_nest];
        Expression& amount = _nest_factors[current_nest];

        Source src = TL::HLT::stripmine_loop(for_statement, amount.prettyprint());

        TL::AST_t tree = src.parse_statement(for_statement.get_ast(), for_statement.get_scope_link());

        // This works because in the next iteration this tree will not be used anymore
        for_statement.get_ast().replace(tree);
    }

    // Now perform interchange
    // If the original nest was N long, the stripmined version will have 2*N
    // loops, so the permutation is {1, i+2, i+4, ..., 2, i+2, i+2, .., 2*N}
    // The following two loops create the permutation itself
    ObjectList<int> permutation;
    for (int i = 1; i <= (int)_nesting; i++)
    {
        permutation.append(2*i-1);
    }
    for (int i = 1; i <= (int)_nesting; i++)
    {
        permutation.append(2*i);
    }

    Source loop_interchange = TL::HLT::loop_interchange(nest_loops[0], permutation);
    return loop_interchange;
}
开发者ID:bsc-pm,项目名称:mcxx,代码行数:38,代码来源:hlt-blocking.cpp

示例14: last_part

ObjectList<TaskPart> TaskAggregation::get_task_parts(Statement stmt)
{
    ObjectList<TaskPart> result;
    ObjectList<Statement> prologue;

    get_task_parts_aux(result, prologue, stmt);

    if (!prologue.empty())
    {
        TaskPart last_part(prologue);
        result.append(last_part);
    }

    return result;
}
开发者ID:bsc-pm,项目名称:mcxx,代码行数:15,代码来源:hlt-task-aggregation.cpp

示例15: get_task_parts_aux

void TaskAggregation::get_task_parts_aux(ObjectList<TaskPart>& result, ObjectList<Statement> &current_prologue, Statement stmt)
{
    if (is_pragma_custom_construct("omp", "task", stmt.get_ast(), stmt.get_scope_link()))
    {
        PragmaCustomConstruct task_construct(stmt.get_ast(), stmt.get_scope_link());
        TaskPart new_task_part(current_prologue, task_construct);
        result.append(new_task_part);
        current_prologue.clear();
    }
    else if (stmt.is_compound_statement())
    {
        ObjectList<Statement> stmt_list = stmt.get_inner_statements();
        for (ObjectList<Statement>::iterator it = stmt_list.begin();
                it != stmt_list.end();
                it++)
        {
            get_task_parts_aux(result, current_prologue, *it);
        }
    }
    else
    {
        current_prologue.append(stmt);
    }
}
开发者ID:bsc-pm,项目名称:mcxx,代码行数:24,代码来源:hlt-task-aggregation.cpp


注:本文中的ObjectList::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。