00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkLightObject_h
00018
#define __itkLightObject_h
00019
00020
#if defined(_MSC_VER)
00021
#pragma warning ( disable : 4786 )
00022
#endif
00023
00024
#include <iostream>
00025
#include <typeinfo>
00026
00027
#include "itkSmartPointer.h"
00028
#include "itkTimeStamp.h"
00029
#include "itkIndent.h"
00030
#include "itkSimpleFastMutexLock.h"
00031
00032
#include "itkMacro.h"
00033
00034
namespace itk
00035 {
00036
00051 class ITKCommon_EXPORT LightObject
00052 {
00053
public:
00055 typedef LightObject
Self;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060
static Pointer New();
00061
00065
virtual void Delete();
00066
00070 virtual const char *GetNameOfClass()
const
00071
{
return "LightObject";}
00072
00073
#ifdef _WIN32
00074
00075
void* operator new(size_t);
00076
void* operator new[](size_t);
00077
void operator delete(
void*);
00078
void operator delete[](
void*, size_t);
00079
#endif
00080
00082
void Print(std::ostream& os)
const;
00083
00086
static void BreakOnError();
00087
00089
virtual void Register() const;
00090
00092 virtual
void UnRegister() const;
00093
00095 virtual
int GetReferenceCount()
const
00096 {
return m_ReferenceCount;}
00097
00100
virtual void SetReferenceCount(
int);
00101
00102
protected:
00103 LightObject():m_ReferenceCount(1) {}
00104 virtual ~LightObject();
00105
00110
virtual void PrintSelf(std::ostream& os,
Indent indent)
const;
00111
virtual void PrintHeader(std::ostream& os,
Indent indent)
const;
00112
virtual void PrintTrailer(std::ostream& os,
Indent indent)
const;
00113
00115
mutable int m_ReferenceCount;
00116
00118
mutable SimpleFastMutexLock m_ReferenceCountLock;
00119
00120 private:
00121 LightObject(
const Self&);
00122
void operator=(
const Self&);
00123
00124
00125 };
00126
00127 }
00128
00129
#endif