Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlLightObject.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: The OpenIGTLink Library
4 Language: C++
5 Web page: http://openigtlink.org/
6
7 Copyright (c) Insight Software Consortium. All rights reserved.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12
13=========================================================================*/
14/*=========================================================================
15
16 Program: Insight Segmentation & Registration Toolkit
17 Module: $RCSfile: itkLightObject.h,v $
18 Language: C++
19 Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
20 Version: $Revision: 3460 $
21
22 Copyright (c) Insight Software Consortium. All rights reserved.
23 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
24
25 This software is distributed WITHOUT ANY WARRANTY; without even
26 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
27 PURPOSE. See the above copyright notices for more information.
28
29=========================================================================*/
30#ifndef __igtlLightObject_h
31#define __igtlLightObject_h
32
33#include "igtlSmartPointer.h"
35#include "igtlMacro.h"
36
37#include <iostream>
38#include <typeinfo>
39
40
41namespace igtl
42{
43
59{
60public:
65
67 static Pointer New();
68
74 virtual Pointer CreateAnother() const;
75
79 virtual void Delete();
80
84 virtual const char *GetNameOfClass() const
85 {return "LightObject";}
86
87#ifdef _WIN32
89 void* operator new(size_t);
90 void* operator new[](size_t);
91 void operator delete(void*);
92 void operator delete[](void*, size_t);
93#endif
95
97 void Print(std::ostream& os) const;
98
101 static void BreakOnError();
102
104 virtual void Register() const;
105
107 virtual void UnRegister() const;
108
110 virtual int GetReferenceCount() const
111 {return m_ReferenceCount;}
112
115 virtual void SetReferenceCount(int);
116
117protected:
118 LightObject():m_ReferenceCount(1) {}
119 virtual ~LightObject();
120
125 virtual void PrintSelf(std::ostream& os) const;
126 virtual void PrintHeader(std::ostream& os) const;
127 virtual void PrintTrailer(std::ostream& os) const;
129
131 mutable volatile int m_ReferenceCount;
132
135
136private:
137 LightObject(const Self&); //purposely not implemented
138 void operator=(const Self&); //purposely not implemented
139
140
141};
142
143} // end namespace igtl
144
145#endif
Light weight base class for most igtl classes.
virtual void SetReferenceCount(int)
virtual void Delete()
virtual ~LightObject()
virtual int GetReferenceCount() const
static void BreakOnError()
virtual void Register() const
volatile int m_ReferenceCount
static Pointer New()
virtual Pointer CreateAnother() const
void Print(std::ostream &os) const
virtual void PrintSelf(std::ostream &os) const
SimpleFastMutexLock m_ReferenceCountLock
SmartPointer< Self > Pointer
virtual void UnRegister() const
virtual void PrintTrailer(std::ostream &os) const
SmartPointer< const Self > ConstPointer
virtual void PrintHeader(std::ostream &os) const
virtual const char * GetNameOfClass() const
Critical section locking class that can be allocated on the stack.
Implements transparent reference counting.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012