X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=381c5d6b942a600aa0a73f4c55a5ddb05bd8a812;hp=551bd13ab877a271c759978caf90dbbcb7750d0f;hb=0d1184b010f26a1620366fa705b18f6376b52698;hpb=23ebdc0a422294764ff3be3f8d7e56cc2b323185 diff --git a/src/common/types.h b/src/common/types.h index 551bd13a..381c5d6b 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,8 @@ 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==(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 +81,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 {