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


C++ Container类代码示例

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


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

示例1: math_model_Pcw

static double math_model_Pcw(double variable, Container<double> in_list) {
    double result=variable;
    result = (((*(in_list.getNextItem()))*sin(((6.283185307179586*(*(in_list.getNextItem())))*((*(in_list.getNextItem()))-(*(in_list.getNextItem()))))*0.016666666666666666))-(*(in_list.getNextItem())))*1.3565;
    return result;
};
开发者ID:velociraptors,项目名称:physio_mist,代码行数:5,代码来源:airway_mechanics_Math_Model.cpp

示例2: end

ContainerIterator Container::end() const
{
	Container* evil = const_cast<Container*>(this);
	return evil->end();
}
开发者ID:Drakos1,项目名称:otxserver,代码行数:5,代码来源:container.cpp

示例3: Q_ASSERT

Object* Analitza::removeDependencies(Object * o) const
{
	Q_ASSERT(o);
	if(o->type()==Object::variable) {
		Ci* var=(Ci*) o;
		qDebug() << "Wanna remove" << var->name() << m_vars->value(var->name());
		if(m_vars->contains(var->name()) && m_vars->value(var->name())) {
			Object *value=Expression::objectCopy(m_vars->value(var->name()));
			Object *no = removeDependencies(value);
			delete o;
			return no;
		}
	} else if(o->type()==Object::container) {
		Container *c = (Container*) o;
		Operator op(c->firstOperator());
		if(c->containerType()==Object::apply && op.isBounded()) { //it is a function
			Container *cbody = c;
			QStringList bvars;
			if(op.operatorType()==Object::function) {
				Ci *func= (Ci*) c->m_params[0];
				Object* body= (Object*) m_vars->value(func->name());
				if(body->type()!=Object::container)
					return body;
				cbody = (Container*) body;
			}
			
			bvars = cbody->bvarList();
			qDebug() << bvars;
			
			if(op.operatorType()==Object::function) {
				QStringList::const_iterator iBvars(bvars.constBegin());
				int i=0;
				for(; iBvars!=bvars.constEnd(); ++iBvars)
					m_vars->stack(*iBvars, c->m_params[++i]);
				delete c;
			}
			
			QList<Object*>::iterator fval(cbody->firstValue());
			qDebug() << "removing: " << (*fval)->toString();
			Object *ret= removeDependencies(Expression::objectCopy(*fval));
			
			QStringList::const_iterator iBvars(bvars.constBegin());
			for(; iBvars!=bvars.constEnd(); ++iBvars)
				m_vars->destroy(*iBvars);
			
			
			if(op.operatorType()==Object::function)
				return ret;
			else {
				delete *fval;
				*fval=ret;
				return c;
			}
		} else {
			QList<Object*>::iterator it(c->m_params.begin());
			for(; it!=c->m_params.end(); ++it)
				*it = removeDependencies(*it);
		}
	}
	return o;
}
开发者ID:BackupTheBerlios,项目名称:kalgebra-svn,代码行数:61,代码来源:analitza.cpp

示例4: math_model_h_conc

static double math_model_h_conc(double variable,Container<double> in_list){
double result = variable;
result = ((*(in_list.getNextItem()))*((*(in_list.getNextItem()))-(*(in_list.getNextItem())))-(*(in_list.getNextItem()))*(*(in_list.getNextItem())))/(*(in_list.getNextItem()));
return result;
};
开发者ID:velociraptors,项目名称:physio_mist,代码行数:5,代码来源:iv_injection_heart_Math_Model.cpp

示例5: ContainerRangeReverse

 ContainerRangeReverse(Container &c) : IteratorRange<typename ContainerProperties<Container>::RBeginType>(c.rbegin(),
                                                                                                          c.rend()) {}
开发者ID:BB90,项目名称:CommunityDetectionCodes,代码行数:2,代码来源:range.hpp

示例6: eval

	static bool eval(const Container& container, const typename Container::key_type& value)
	{
		return container.find(value) != container.end();
	}
开发者ID:fluffbeast,项目名称:wesnoth-old,代码行数:4,代码来源:general.hpp

示例7: adjacent_for_each

void adjacent_for_each(Container & c, BinaryFunction func)
{
    adjacent_for_each(c.begin(), c.end(), func);
}
开发者ID:mlove-au,项目名称:utils,代码行数:4,代码来源:adjacent_for_each.hpp

示例8: loadAccount


//.........这里部分代码省略.........
				guild->setMemberCount(result->getNumber<uint32_t>("members"));
			}
		}
	}

	query.str(std::string());
	query << "SELECT `player_id`, `name` FROM `player_spells` WHERE `player_id` = " << player->getGUID();
	if ((result = db->storeQuery(query.str()))) {
		do {
			player->learnedInstantSpellList.emplace_front(result->getString("name"));
		} while (result->next());
	}

	//load inventory items
	ItemMap itemMap;

	query.str(std::string());
	query << "SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_items` WHERE `player_id` = " << player->getGUID() << " ORDER BY `sid` DESC";
	if ((result = db->storeQuery(query.str()))) {
		loadItems(itemMap, result);

		for (ItemMap::const_reverse_iterator it = itemMap.rbegin(), end = itemMap.rend(); it != end; ++it) {
			const std::pair<Item*, int32_t>& pair = it->second;
			Item* item = pair.first;
			int32_t pid = pair.second;
			if (pid >= 1 && pid <= 10) {
				player->internalAddThing(pid, item);
			} else {
				ItemMap::const_iterator it2 = itemMap.find(pid);
				if (it2 == itemMap.end()) {
					continue;
				}

				Container* container = it2->second.first->getContainer();
				if (container) {
					container->internalAddThing(item);
				}
			}
		}
	}

	//load depot items
	itemMap.clear();

	query.str(std::string());
	query << "SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_depotitems` WHERE `player_id` = " << player->getGUID() << " ORDER BY `sid` DESC";
	if ((result = db->storeQuery(query.str()))) {
		loadItems(itemMap, result);

		for (ItemMap::const_reverse_iterator it = itemMap.rbegin(), end = itemMap.rend(); it != end; ++it) {
			const std::pair<Item*, int32_t>& pair = it->second;
			Item* item = pair.first;

			int32_t pid = pair.second;
			if (pid >= 0 && pid < 100) {
				DepotChest* depotChest = player->getDepotChest(pid, true);
				if (depotChest) {
					depotChest->internalAddThing(item);
				}
			} else {
				ItemMap::const_iterator it2 = itemMap.find(pid);
				if (it2 == itemMap.end()) {
					continue;
				}

				Container* container = it2->second.first->getContainer();
开发者ID:samuel2498,项目名称:hak,代码行数:67,代码来源:iologindata.cpp

示例9: math_model_Pcc

static double math_model_Pcc(double variable, Container<double> in_list) {
    double result=variable;
    result = (*(in_list.getNextItem()))+(*(in_list.getNextItem()));
    return result;
};
开发者ID:velociraptors,项目名称:physio_mist,代码行数:5,代码来源:airway_mechanics_Math_Model.cpp

示例10: insert

	iterator insert(Container &container)
	{
		return __insert(container.begin(), container.end());
	}
开发者ID:darrengarvey,项目名称:Boost.Trie,代码行数:4,代码来源:trie.hpp

示例11: math_model_PplcFOL

static double math_model_PplcFOL(double variable,Container<double> in_list) {
    double result = variable;
    result = ((*(in_list.getNextItem()))-(*(in_list.getNextItem())))/(0.001);
    return result;
};
开发者ID:velociraptors,项目名称:physio_mist,代码行数:5,代码来源:airway_mechanics_Math_Model.cpp

示例12: math_model_Pmouth

static double math_model_Pmouth(double variable, Container<double> in_list) {
    double result=variable;
    result = (*(in_list.getNextItem()))*1.3565;
    return result;
};
开发者ID:velociraptors,项目名称:physio_mist,代码行数:5,代码来源:airway_mechanics_Math_Model.cpp

示例13: math_model_PplmmHg

static double math_model_PplmmHg(double variable, Container<double> in_list) {
    double result=variable;
    result = (*(in_list.getNextItem()))*.7371913011426465;
    return result;
};
开发者ID:velociraptors,项目名称:physio_mist,代码行数:5,代码来源:airway_mechanics_Math_Model.cpp

示例14: RangeHash

std::size_t RangeHash(Container c, std::size_t total_hash = 0)
{
  return RangeHash(c.begin(), c.end(), total_hash);
}
开发者ID:graehl,项目名称:hyp,代码行数:4,代码来源:Syms.hpp

示例15: Range

 Range ( Container const& cont )
     : begin_( cont.begin() )
     , end_(   cont.end() )
 {}
开发者ID:lczech,项目名称:genesis,代码行数:4,代码来源:range.hpp


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