X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fptr.h;h=636cbd8ee9ac8911ba39df996dfa3e1f8e6e0942;hp=0c957d7c600bbf64fe71869fa16acac91c357fdf;hb=5d6d2c3ff6afd13933203f984a818dbfc76db3a1;hpb=695f6ae955ec530cded8f21efd5569df39447f76 diff --git a/ginac/ptr.h b/ginac/ptr.h index 0c957d7c..636cbd8e 100644 --- a/ginac/ptr.h +++ b/ginac/ptr.h @@ -3,7 +3,7 @@ * Reference-counted pointer template. */ /* - * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,33 +17,32 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_PTR_H__ -#define __GINAC_PTR_H__ +#ifndef GINAC_PTR_H +#define GINAC_PTR_H + +#include "assertion.h" #include // for size_t #include #include -#include "assertion.h" - namespace GiNaC { - /** Base class for reference-counted objects. */ class refcounted { public: refcounted() throw() : refcount(0) {} - size_t add_reference() throw() { return ++refcount; } - size_t remove_reference() throw() { return --refcount; } - size_t get_refcount() const throw() { return refcount; } - void set_refcount(size_t r) throw() { refcount = r; } + unsigned int add_reference() throw() { return ++refcount; } + unsigned int remove_reference() throw() { return --refcount; } + unsigned int get_refcount() const throw() { return refcount; } + void set_refcount(unsigned int r) throw() { refcount = r; } private: - size_t refcount; ///< reference counter + unsigned int refcount; ///< reference counter }; @@ -166,4 +165,4 @@ template struct less< GiNaC::ptr > } // namespace std -#endif // ndef __GINAC_PTR_H__ +#endif // ndef GINAC_PTR_H