root/trunk/src/shared/Base.h @ 118

Revision 2, 1.6 kB (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00

Line 
1/*
2    Base class interface
3    Copyright (C) 1998,1999 by Andrew Zabolotny
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License as published by the Free Software Foundation; either
8    version 2 of the License, or (at your option) any later version.
9
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public
16    License along with this library; if not, write to the Free
17    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/
19
20#ifndef __BASE_H__
21#define __BASE_H__
22
23#include "Common.h"
24
25/**
26 * This class is intended to be a base class for every other class.
27 * It defines the basic interface available for any object.
28 */
29class Base
30{
31    private:
32        /// Object reference count
33        int RefCount;
34
35    protected:
36        /**
37         * Destroy this object. Destructor is virtual, because class contains
38         * virtual methods; also it is private because it is never intended
39         * to be called directly; use DecRef() instead: when reference counter
40         * reaches zero, the object will be destroyed.
41         */
42        virtual ~Base ();
43
44    public:
45
46        Base ();
47
48        void IncRef ();
49
50        void DecRef ();
51        int GetRefCount ();
52
53};
54#endif                                                      // __BASE_H__
Note: See TracBrowser for help on using the browser.