Go to the documentation of this file.
14 #include <initializer_list>
56 class BaseSet :
public std::set<F>,
public virtual OutputOperator {
77 template<
class G,
class H>
82 template<
class G,
class H>
87 template<
class G,
class H,
class I,
class J>
110 inline bool isempty()
const {
return this->begin() == this->end(); }
112 virtual std::ostream&
info(std::ostream& os)
const;
144 std::string(
" can not be created. The input symbol ` ") +
145 std::string(std::istreambuf_iterator<char>(is), {}).substr(0,1) +
146 std::string(
" ` does not meet the conversion criteria"
147 " of the operator>>, failbit was setted to true."));
154 if (str.size() > 0) {
163 const F* e = (
const F*)a;
164 for(uint i = a.
size(); i--;) this->insert(*e++);
169 template<
class G,
class H>
173 G val = ((*i)->*fun)();
180 template<
class G,
class H>
184 G* val = &((*i)->*fun)();
191 template<
class G,
class H,
class I,
class J>
195 G val = ((*is)->*fun)(i);
204 union_(set.begin(), set.end(), inserter(result, result.begin()));
211 union_(set.begin(), set.end(), inserter(result, result.begin()));
218 intersection_(set.begin(), set.end(), inserter(result, result.begin()));
225 intersection_(set.begin(), set.end(), inserter(result, result.begin()));
232 set_intersection(this->begin(), this->end(), first, last, i);
238 set_union(this->begin(), this->end(), first, last, i);
244 set_difference(this->begin(), this->end(), first, last, i);
250 difference_(set.begin(), set.end(), inserter(result, result.begin()));
257 difference_(set.begin(), set.end(), inserter(result, result.begin()));
263 std::set<uint> result;
266 if (*is == val) result.insert(i);
274 typename std::set<uint>::const_iterator it = set.begin();
276 while(it != set.end() && is != this->end()) {
289 set_union(this->begin(), this->end(),
290 set.begin(), set.end(),
291 inserter(*
this, this->begin()));
297 return this->find(val) != this->end();
305 if (++i != this->end()) os <<
", ";
325 va_start(param, first);
326 for(uint i = 1; i < n; ++i)
327 data.insert(va_arg(param, F));
uint size() const
Returns the requested size of the array.
Set< G > operator()(G(H::*fun)() const) const
Returns element wise application of a member function, e.g.
Set< F > operator&&(const Set< F > &set) const
virtual void intersection_(const_iterator_ first, const_iterator_ last, insert_iterator_ i) const
Insert the set intersection of this set with that between iterator first and second into i.
void pointerOutput(std::ostream &os, const F &val)
virtual std::ostream & info(std::ostream &os) const
Set with operations, output operator, and method of the particular element types.
std::insert_iterator< std::set< F > > insert_iterator_
BaseSet(const std::string &str)
Constructor, set is defined by a string.
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Set< F > makeSet(uint n, const F &first,...)
Creates an array of length from a comma separated list of values.
std::istream & operator>>(std::istream &is, BaseSequence< F > &seq)
BaseSet(const G &set)
Constructor, which uses the constructor of the base class std::set.
BaseSet(const concepts::Array< F > &a)
Constructor, set is defined by an array.
BaseSet< F > & operator|=(const Set< F > &set)
#define DEBUGL(doit, msg)
Set< F > operator-(const Set< F > &set) const
Set< G > operator()(G(H::*fun)(I) const, J i) const
Returns element wise application of a member function, e.g.
virtual void difference_(const_iterator_ first, const_iterator_ last, insert_iterator_ i) const
Insert the set difference of this set with that between iterator first and second into i.
Exception class for assertions.
BaseSet()
Standard Constructor.
Set< uint > operator==(const F val) const
Returns the indices of elements with are equal to val.
std::set< F >::const_iterator const_iterator_
bool isempty() const
Returns true, if set is empty.
Set with operations and output operator.
Set< F > operator||(Set< F > &set) const
virtual void union_(const_iterator_ first, const_iterator_ last, insert_iterator_ i) const
Insert the set union of this set with that between iterator first and second into i.
Set< F > operator&&(Set< F > &set) const
Set< F > operator-(Set< F > &set) const
bool exist(F val) const
Returns true, if a value is in the set.
std::string typeOf(const T &t)
Return the typeid name of a class object.
Set< G * > operator()(G &(H::*fun)() const) const
Returns element wise application of a member function, e.g.
Set< F > operator||(const Set< F > &set) const
Set< F > operator()(const Set< uint > &set) const
Returns subset with indices set.
Basic namespace for Concepts-2.