X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Funiqueid.h;h=cab65936d21fe0cf20722d59af75d79537922137;hb=a844921624f813ecafac3f34104c1078b9e375f2;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..cab6593 100644 --- a/synfig-core/trunk/src/synfig/uniqueid.h +++ b/synfig-core/trunk/src/synfig/uniqueid.h @@ -2,7 +2,7 @@ /*! \file uniqueid.h ** \brief Template Header ** -** $Id: uniqueid.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley @@ -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_