X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=9793150d138fe2184ae8ffe3b27af1b856f526fa;hb=d28b9ec38b6ea0bc473200fc2f1e65abd1b56bd6;hp=05fdf2cf542142ab0dc62296d9caff9158bf625b;hpb=8699dd758516d0ded076811e8ea656adc95e69d0;p=quassel.git diff --git a/src/common/types.h b/src/common/types.h index 05fdf2cf..9793150d 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -23,12 +23,30 @@ #include +/* +class UnsignedId { + quint32 id; + + public: + inline UnsignedId(int _id = 0) { id = _id; } + inline quint32 toInt() const { return id; } + inline bool operator==(const UnsignedId &other) const { return id == other.id; } + inline bool operator!=(const UnsignedId &other) const { return id != other.id; } +}; + +struct BufferId : public UnsignedId { + inline BufferId(int _id = 0) : UnsignedId(_id) {}; + +}; +*/ + // FIXME make all ID types quint32 as soon as they all have been replaced typedef uint UserId; //!< Identifies a core user. typedef uint MsgId; //!< Identifies a message. typedef uint BufferId; //!< Identifies a buffer. -typedef uint NetworkId; //!< Identifies an IRC Network. -typedef quint32 IdentityId; //!< Identifies an identity. +// These must be signed! +typedef qint32 NetworkId; //!< Identifies an IRC Network. +typedef qint32 IdentityId; //!< Identifies an identity. //! Base class for exceptions. struct Exception {