ALBA
albaReferenceCounted.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaReferenceCounted
5 Authors: based on vtkObjectBase (www.vtk.org), adapted Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaReferenceCounted_h
18#define __albaReferenceCounted_h
19
20#include "albaObject.h"
21
34class ALBA_EXPORT albaReferenceCounted : public albaObject
35{
36public:
39
41
47 virtual void Delete();
48
50 void Register(void *obj);
51
56 virtual void UnRegister(void *obj);
57
59 int GetReferenceCount() {return m_ReferenceCount;}
60
63
64protected:
66};
67
68#endif
69
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38
albaReferenceCounted - abstract base class for ALBA objects with reference counting.
int m_ReferenceCount
Number of uses of this object by other objects.
albaAbstractTypeMacro(albaReferenceCounted, albaObject)
int GetReferenceCount()
Return the current reference count of this object.
void SetReferenceCount(int)
Sets the reference count.
virtual void UnRegister(void *obj)
Decrease the reference count (release by another object).
virtual void Delete()
Delete a ALBA object.
void Register(void *obj)
Increase the reference count (mark as used by another object).
virtual ~albaReferenceCounted()