X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=0154247e75a0acb800201cea2a2b6b32d8b65cd4;hb=3244e636b430b415aa76ba1885798d41627f7cfb;hp=551bd13ab877a271c759978caf90dbbcb7750d0f;hpb=23ebdc0a422294764ff3be3f8d7e56cc2b323185;p=quassel.git diff --git a/src/common/types.h b/src/common/types.h index 551bd13a..0154247e 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _TYPES_H_ -#define _TYPES_H_ +#ifndef TYPES_H_ +#define TYPES_H_ #include #include @@ -37,6 +37,9 @@ class SignedId { inline bool operator==(const SignedId &other) const { return id == other.id; } inline bool operator!=(const SignedId &other) const { return id != other.id; } inline bool operator<(const SignedId &other) const { return id < other.id; } + inline bool operator<=(const SignedId &other) const { return id <= other.id; } + inline bool operator>(const SignedId &other) const { return id > other.id; } + inline bool operator>=(const SignedId &other) const { return id >= other.id; } inline bool operator==(int i) const { return id == i; } inline bool operator!=(int i) const { return id != i; } inline bool operator<(int i) const { return id < i; } @@ -79,11 +82,16 @@ struct IdentityId : public SignedId { //inline operator QVariant() const { return QVariant::fromValue(*this); } }; +struct AccountId : public SignedId { + inline AccountId(int _id = 0) : SignedId(_id) {}; +}; + Q_DECLARE_METATYPE(UserId); Q_DECLARE_METATYPE(MsgId); Q_DECLARE_METATYPE(BufferId); Q_DECLARE_METATYPE(NetworkId); Q_DECLARE_METATYPE(IdentityId); +Q_DECLARE_METATYPE(AccountId); //! Base class for exceptions. struct Exception {