X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fguid.h;h=c8226282c3688a957f35aa189b08d83c478a70b6;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=791f29f254ca5192843a1bbb54c84e9b4e767180;hpb=e3acc0b267b14fda5db3c7bbb2f218b993ef84b3;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/guid.h b/synfig-core/trunk/src/synfig/guid.h index 791f29f..c822628 100644 --- a/synfig-core/trunk/src/synfig/guid.h +++ b/synfig-core/trunk/src/synfig/guid.h @@ -1,28 +1,29 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file guid.h ** \brief Template Header ** -** $Id: guid.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ /* === S T A R T =========================================================== */ -#ifndef __SINFG_GUID_H -#define __SINFG_GUID_H +#ifndef __SYNFIG_GUID_H +#define __SYNFIG_GUID_H /* === H E A D E R S ======================================================= */ @@ -36,8 +37,8 @@ /* === C L A S S E S & S T R U C T S ======================================= */ -namespace sinfg { - +namespace synfig { + class GUID { union { @@ -51,24 +52,24 @@ class GUID uint64_t a; uint64_t b; } u_64; - + } data; - + public: GUID() - { make_unique(); } + { make_unique(); } GUID(const GUID& x):data(x.data) { } - GUID(const int i){assert(!i); data.u_64.a=0;data.u_64.b=0;} + GUID(const int i __attribute__ ((unused))){assert(!i); data.u_64.a=0;data.u_64.b=0;} GUID(const String& str); - + static GUID zero() { return GUID(0); } static GUID hasher(const String& str); static GUID hasher(int i); operator bool()const { return data.u_32.a||data.u_32.b||data.u_32.c||data.u_32.d; } - + uint64_t get_hi()const { return data.u_64.a; } uint64_t get_lo()const { return data.u_64.b; } @@ -76,10 +77,10 @@ public: uint64_t get_hi_lo()const { return data.u_32.b; } uint64_t get_lo_hi()const { return data.u_32.c; } uint64_t get_lo_lo()const { return data.u_32.d; } - + void make_unique(); String get_string()const; - + bool operator==(const GUID& rhs)const { return data.u_64.a==rhs.data.u_64.a && data.u_64.b==rhs.data.u_64.b; } bool operator!=(const GUID& rhs)const @@ -105,7 +106,7 @@ public: return *this; } GUID operator^(const GUID& rhs)const { return GUID(*this)^=rhs; } - + //! Operator '%' (alt-xor) /*! A % B != B % A. */ GUID& operator%=(const GUID& rhs)