本文整理汇总了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;
};
示例2: end
ContainerIterator Container::end() const
{
Container* evil = const_cast<Container*>(this);
return evil->end();
}
示例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;
}
示例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;
};
示例5: ContainerRangeReverse
ContainerRangeReverse(Container &c) : IteratorRange<typename ContainerProperties<Container>::RBeginType>(c.rbegin(),
c.rend()) {}
示例6: eval
static bool eval(const Container& container, const typename Container::key_type& value)
{
return container.find(value) != container.end();
}
示例7: adjacent_for_each
void adjacent_for_each(Container & c, BinaryFunction func)
{
adjacent_for_each(c.begin(), c.end(), func);
}
示例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();
示例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;
};
示例10: insert
iterator insert(Container &container)
{
return __insert(container.begin(), container.end());
}
示例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;
};
示例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;
};
示例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;
};
示例14: RangeHash
std::size_t RangeHash(Container c, std::size_t total_hash = 0)
{
return RangeHash(c.begin(), c.end(), total_hash);
}
示例15: Range
Range ( Container const& cont )
: begin_( cont.begin() )
, end_( cont.end() )
{}