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 
41 namespace igtl
42 {
43 
59 {
60 public:
62  typedef LightObject Self;
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
88 
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
94 
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 
117 protected:
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 
136 private:
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
SmartPointer< const Self > ConstPointer
volatile int m_ReferenceCount
virtual int GetReferenceCount() const
#define IGTLCommon_EXPORT
SimpleFastMutexLock m_ReferenceCountLock
Light weight base class for most igtl classes.
SmartPointer< Self > Pointer
Critical section locking class that can be allocated on the stack.
virtual const char * GetNameOfClass() const

Generated at Wed Dec 4 2013 03:48:28 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012