本文整理汇总了C++中Constraints::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Constraints::end方法的具体用法?C++ Constraints::end怎么用?C++ Constraints::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constraints
的用法示例。
在下文中一共展示了Constraints::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Constraints::Constraints (Constraints &cs): std::map <std::string, ConstraintPtr > (cs)
{
for (Constraints::iterator iter = cs.begin (); iter != cs.end (); iter++)
{
Constraint *con = createConstraint (iter->first.c_str ());
// can "compare" chars, as they are const char*
if (con->getName () == CONSTRAINT_TIME
|| con->getName () == CONSTRAINT_AIRMASS
|| con->getName () == CONSTRAINT_ZENITH_DIST
|| con->getName () == CONSTRAINT_HA
|| con->getName () == CONSTRAINT_LDISTANCE
|| con->getName () == CONSTRAINT_LALTITUDE
|| con->getName () == CONSTRAINT_LPHASE
|| con->getName () == CONSTRAINT_SDISTANCE
|| con->getName () == CONSTRAINT_SALTITUDE)
{
((ConstraintInterval *) con)->copyIntervals (((ConstraintInterval *) iter->second->th ()));
}
else if (con->getName () == CONSTRAINT_MAXREPEATS)
{
((ConstraintMaxRepeat *) con)->copyConstraint (((ConstraintMaxRepeat *) iter->second->th ()));
}
else
{
std::cerr << "unsuported constraint type in copy constructor " __FILE__ ":" << __LINE__ << std::endl;
exit (10);
}
(*this)[iter->first] = ConstraintPtr (con);
}
}
示例2: hasConstraint
bool hasConstraint(const ConstraintPtr& c, const Constraints& cs) {
Constraints r;
for (Constraints::const_iterator ci = cs.begin(); ci != cs.end(); ++ci) {
if (*c == **ci) {
return true;
}
}
return false;
}
示例3: removeConstraint
Constraints removeConstraint(const ConstraintPtr& c, const Constraints& cs) {
Constraints r;
for (Constraints::const_iterator ci = cs.begin(); ci != cs.end(); ++ci) {
if (!(*c == **ci)) {
r.push_back(*ci);
}
}
return r;
}