The
base class of all structures that are monoids.
More...
Public Types | |
typedef Self | self_t |
Exact type of the most derived type in the hierarchy. | |
Public Member Functions | |
template<typename T > | |
Element< Self, T > | identity (SELECTOR(T)) const |
Returns the identity of the monoid (if mul_kind). | |
template<typename T > | |
Element< Self, T > | zero (SELECTOR(T)) const |
Returns the zero of the monoid (if add_kind). | |
bool | contains (const Element< Self, T > &elt) const |
Check if a given element is compatible with the structural element. | |
bool | contains (const Element< OtherS, T > &other) const |
Specialization of contains that always returns false. | |
bool | contains (const T &elt_value) const |
Check if an anonymous value is compatible with a structural element. | |
Element< Self, T > | choose (SELECTOR(T)) const |
Choose randomly an element in the structure. | |
self_t & | self () |
Accessor to the real type. | |
const self_t & | self () const |
Accessor to the real type. | |
Protected Member Functions | |
MonoidBase () | |
Protected since it is an abstract class. | |
MonoidBase (const MonoidBase &other) | |
Protected since it is an abstract class. |
The
base class of all structures that are monoids.
Monoid defines identity for semigroups of mul_kind and zero for semigroup of add_kind.
Definition at line 41 of file monoid_base.hh.
bool contains | ( | const Element< OtherS, T > & | other | ) | const [inline, inherited] |
Specialization of contains
that always returns false.
Indeed, elements structured by a particular type are always incompatible with structural elements of another type.
self_t& self | ( | ) | [inherited] |
Accessor to the real type.
To be used by implementations in this class and derived structures to obtain a reference to the structural element with its most derived type.
const self_t& self | ( | ) | const [inherited] |
Accessor to the real type.
To be used by implementations in this class and derived structures to obtain a reference to the structural element with its most derived type.