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


C++ list_t类代码示例

本文整理汇总了C++中list_t的典型用法代码示例。如果您正苦于以下问题:C++ list_t类的具体用法?C++ list_t怎么用?C++ list_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: formatList

string View::formatList(list_t &list, const string d1, const string sep, const string d2) {
  string output = "";
  if(list.empty()) return output;
  FOR_l(i,list)
    output = output + (i==0 || is_dir(list[i-1]) || is_opt(list[i-1]) ? "" : sep) + list.at(i);
  return d1 + output + d2;
}
开发者ID:malloc47,项目名称:term-do,代码行数:7,代码来源:view.cpp

示例2: getRelationModel

relation_data_t Query::getRelationModel(list_t values, Model * & model)
{
    relation_data_t rData;
    QList <Model *> list;
    if(!values.empty())
    {
        QStringList fields = model->getSchema()->getFields();
        int i = 0;
        while(i < values.size())
        {
            int j = i;
            Model * temp = new Model();
            temp->setSchema(model->getSchema());
            temp->setIsNew(false);
            while(values[j] != QPair <QString, QVariant> ("", ""))
            {
                if((fields.contains(values[j].first)) && (values[j].second != ""))
                {
                    temp->setField(values[j].first, values[j].second);
                }                
                j++;
            }
            list.append(temp);
            i = j + 1;
        }
    }
    rData.insert(rName, list);
    return rData;
}
开发者ID:Aspenka,项目名称:SSD,代码行数:29,代码来源:Query.cpp

示例3: MEM_CacheLimiterHandleCClass

handle_t *MEM_CacheLimiterCClass::insert(void *data)
{
	cclass_list.push_back(new MEM_CacheLimiterHandleCClass(data, this));
	list_t::iterator it = cclass_list.end();
	--it;
	cclass_list.back()->set_iter(it);

	return cache.insert(cclass_list.back());
}
开发者ID:Aligorith,项目名称:blender,代码行数:9,代码来源:MEM_CacheLimiterC-Api.cpp

示例4: chopList

list_t View::chopList(list_t list, const string prefix) {
  if(list.empty()) return list;
  FOR_l(i,list) {
    string item = list[i];
    // normal chop
    if(!item.compare(0,prefix.length(),prefix))
      list.at(i) = item.substr(prefix.length());
    else
      list.at(i) = "["+item+"]";
  }
开发者ID:malloc47,项目名称:term-do,代码行数:10,代码来源:view.cpp

示例5: remove_even

static void remove_even(list_t &l) {
    bool even = false;
    for (auto it = l.begin(); it != l.end();) {
        if (even)
            it = l.erase(it);
        else
            ++it;

        even = !even;
    }
}
开发者ID:SubutaiBogatur,项目名称:CPP-Homework,代码行数:11,代码来源:tests.cpp

示例6:

/*@[email protected]*/ static node_t list_get_node_by_value(list_t inst, void* val) {
	node_t n = inst->head;
	int ctr = 0;
	while ((n != NULL) && (inst->cmp(node_get_value(n), val))) {
		ctr++;
		n = n->next;
	}
	return n;
}
开发者ID:dsmrd,项目名称:dsmrd,代码行数:9,代码来源:list.c

示例7: list_find

int list_find(list_t list, void *data){
    struct list_node *p = list->head;
    int i = 0;
    while (p != NULL) {
        if (list->eq(p->data, data))
            return i;
        i++;
        p = p->next;
    }
    return -1;
}
开发者ID:pocketzeroes,项目名称:proekt,代码行数:11,代码来源:design-hashmap.c

示例8: list_index_of

int list_index_of(list_t inst, void* val) {
	node_t n = inst->head;
	int rval = 0;
	while ((n != NULL) && (inst->cmp(node_get_value(n), val))) {
		rval++;
		n = n->next;
	}
	if (n == NULL) {
		rval = -1;
	}
	return rval;
}
开发者ID:dsmrd,项目名称:dsmrd,代码行数:12,代码来源:list.c

示例9: generate

string_t
generate(const string_t& method, const list_t& arguments)
{
	std::string call("H\x02\x00""C"s);

	generator::value_visitor visitor(call);
	visitor(method);
	visitor(static_cast<int_t>(arguments.size()));
	for (const auto& argument : arguments)
		boost::apply_visitor(visitor, argument);

	return std::move(call);
}
开发者ID:octopus-prime,项目名称:hessian_x3,代码行数:13,代码来源:generator.cpp

示例10: walk2

int walk2(list_t::iterator it, int s, int t)
{
    if(s==t) return 0;
    for(int i=0;i<30;i++)
    {
        if(links[s][i].size())
        {
            output.insert(it, mp(links[s][i].back(),s));
            links[s][i].pop_back();
            return walk2(it, i,t);
        }
    }
    return -1;
}
开发者ID:blmarket,项目名称:icpc,代码行数:14,代码来源:WORDCHAIN.cpp

示例11: pump

int pump(list_t::iterator it)
{
    int pos = it->second;
redo:
    for(int i=0;i<30;i++)
    {
        if(links[pos][i].size())
        {
            output.insert(it, mp(links[pos][i].back(), pos));
            links[pos][i].pop_back();
            if(walk2(it, i, pos) == -1) return -1;
            goto redo;
        }
    }
    return 0;
}
开发者ID:blmarket,项目名称:icpc,代码行数:16,代码来源:WORDCHAIN.cpp

示例12: if

gboolean
post_parse()
{
    if (file_ != 0)
    {
    	if (tofile_ == 0 && todir_ == 0)
	{
	    log::errorf("One of \"tofile\" or \"todir\" must be specified with \"file\"\n");
	    return FALSE;
	}
    }
    else if (filesets_.first() != 0)
    {
    	if (tofile_ != 0)
	{
	    log::errorf("Only \"todir\" is allowed with \"filesets\"\n");
	    return FALSE;
	}
    	if (todir_ == 0)
	{
	    log::errorf("Must use \"todir\" is \"filesets\"\n");
	    return FALSE;
	}
    }
    else if (file_ == 0 && filesets_.first() == 0)
    {
    	log::errorf("At least one of \"file\" or \"<fileset>\" must be present\n");
	return FALSE;
    }

    if (mapper_ == 0)
    	mapper_ = mapper_t::create("identity", 0, 0);

    return TRUE;
}
开发者ID:gnb,项目名称:cant,代码行数:35,代码来源:task_copy.C

示例13: touch

 /** Mark an element as recently used. */
 void touch (const key_type& k)
 {
     auto found (map_.find(k));
     assert(found != map_.end());
     if (found != map_.end())
         list_.splice(list_.begin(), list_, found->second);
 }
开发者ID:friederschueler,项目名称:hexahedra,代码行数:8,代码来源:lru_cache.hpp

示例14: found

    boost::optional<mapped_type&> try_get (const key_type& k)
    {
        auto found (map_.find(k));
        if (found == map_.end())
            return boost::optional<mapped_type&>();

        list_.splice(list_.begin(), list_, found->second);
        return found->second->second;
    }
开发者ID:friederschueler,项目名称:hexahedra,代码行数:9,代码来源:lru_cache.hpp

示例15: prune

 /** Prune the cache back to a given size.
  *  If the cache is larger than the maximum, the oldest entries
  *  will be deleted.
  * @post size() <= max_size
  * @param max_size  The maximum cache size */
 void prune (size_t max_size)
 {
     while (size_ > max_size)
     {
         map_.erase(list_.back().first);
         list_.pop_back();
         --size_;
     }
 }
开发者ID:friederschueler,项目名称:hexahedra,代码行数:14,代码来源:lru_cache.hpp


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