X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=9793150d138fe2184ae8ffe3b27af1b856f526fa;hb=d28b9ec38b6ea0bc473200fc2f1e65abd1b56bd6;hp=9e62ffd830c418d52a45a3a7dccf4371a8805979;hpb=d6b056e936ec441258d291b7a8af7b83f9f53016;p=quassel.git diff --git a/src/common/types.h b/src/common/types.h index 9e62ffd8..9793150d 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -23,10 +23,30 @@ #include -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. +/* +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. +// These must be signed! +typedef qint32 NetworkId; //!< Identifies an IRC Network. +typedef qint32 IdentityId; //!< Identifies an identity. //! Base class for exceptions. struct Exception {