X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Funiqueid.h;h=2f3c74218b1c3b2fd53c4bd71dbda6acf38a1d76;hb=36d01e1527fda602a9aed07d209eb34e6770bca8;hp=6fd4f29441b4042eae597e6c723a6f71dd2737ec;hpb=e8a065f2385c219c511b57dac52786120bfa097d;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/uniqueid.h b/synfig-core/trunk/src/synfig/uniqueid.h index 6fd4f29..2f3c742 100644 --- a/synfig-core/trunk/src/synfig/uniqueid.h +++ b/synfig-core/trunk/src/synfig/uniqueid.h @@ -34,40 +34,40 @@ /* === C L A S S E S & S T R U C T S ======================================= */ namespace synfig { - + class UniqueIDLessThan; - + /*! \class UniqueID ** \brief \todo */ class UniqueID { friend class UniqueIDLessThan; - + int id_; - + explicit UniqueID(int id_):id_(id_) { } - + static int next_id(); - + public: - + //! Returns the internal unique identifier for this object. /*! The return value from this isn't really useful for ** much other than debug output. Nonetheless, that is ** one step above useless, so here it is. */ const int &get_uid()const { return id_; } - + UniqueID():id_(next_id()) { } - + void make_unique() { id_=next_id(); } - + static const UniqueID nil() { return UniqueID(0); } - + operator bool()const { return static_cast(id_); } void mimic(const UniqueID& x) { id_=x.id_; } - + bool operator==(const UniqueID &rhs)const { return id_==rhs.id_; } bool operator!=(const UniqueID &rhs)const { return id_!=rhs.id_; } bool operator<(const UniqueID &rhs)const { return id_