MySQL++
3.3.0
|
Mix-in that gives its subclass a full set of comparison operators. More...
#include <comparable.h>
Public Member Functions | |
bool | operator== (const T &other) const |
Returns true if "other" is equal to this object. | |
bool | operator!= (const T &other) const |
Returns true if "other" is not equal to this object. | |
bool | operator< (const T &other) const |
Returns true if "other" is less than this object. | |
bool | operator<= (const T &other) const |
Returns true if "other" is less than or equal to this object. | |
bool | operator> (const T &other) const |
Returns true if "other" is greater than this object. | |
bool | operator>= (const T &other) const |
Returns true if "other" is greater than or equal to this object. | |
Protected Member Functions | |
virtual | ~Comparable () |
Destroy object. More... | |
virtual int | compare (const T &other) const =0 |
Compare this object to another of the same type. More... | |
Mix-in that gives its subclass a full set of comparison operators.
Simply by inheriting publically from this and implementing compare(), the subclass gains a full set of comparison operators, because all of the operators are implemented in terms of compare().
|
inlineprotectedvirtual |
Destroy object.
This class has nothing to destroy, but declaring the dtor virtual placates some compilers set to high warning levels. Protecting it ensures you can't delete subclasses through base class pointers, which makes no sense because this class isn't made for polymorphism. It's just a mixin.
|
protectedpure virtual |
Compare this object to another of the same type.
Returns < 0 if this object is "before" the other, 0 of they are equal, and > 0 if this object is "after" the other.
Implemented in mysqlpp::Time, mysqlpp::DateTime, and mysqlpp::Date.
Referenced by mysqlpp::Comparable< T >::operator!=(), mysqlpp::Comparable< T >::operator<(), mysqlpp::Comparable< T >::operator<=(), mysqlpp::Comparable< T >::operator==(), mysqlpp::Comparable< T >::operator>(), and mysqlpp::Comparable< T >::operator>=().