Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
igtl::LightObject Class Reference

#include <igtlLightObject.h>

Inheritance diagram for igtl::LightObject:
Inheritance graph
[legend]
Collaboration diagram for igtl::LightObject:
Collaboration graph
[legend]

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual Pointer CreateAnother () const
 
virtual void Delete ()
 
virtual const char * GetNameOfClass () const
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os) const
 
virtual void Register () const
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const
 

Static Public Member Functions

static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 LightObject ()
 
virtual ~LightObject ()
 
virtual void PrintSelf (std::ostream &os) const
 
virtual void PrintHeader (std::ostream &os) const
 
virtual void PrintTrailer (std::ostream &os) const
 

Protected Attributes

volatile int m_ReferenceCount
 
SimpleFastMutexLock m_ReferenceCountLock
 

Detailed Description

Light weight base class for most igtl classes.

LightObject is the highest level base class for most igtl objects. It implements reference counting and the API for object printing. It can be used as a lightweight base class in preference to Object. (LightObject does not support callbacks or modified time as Object does.) All IGTL objects should be a subclass of LightObject or Object with few exceptions (due to performance concerns).

See also
Object

Definition at line 58 of file igtlLightObject.h.

Member Typedef Documentation

Definition at line 64 of file igtlLightObject.h.

Definition at line 63 of file igtlLightObject.h.

Standard clas typedefs.

Definition at line 62 of file igtlLightObject.h.

Constructor & Destructor Documentation

igtl::LightObject::LightObject ( )
inlineprotected

Definition at line 118 of file igtlLightObject.h.

virtual igtl::LightObject::~LightObject ( )
protectedvirtual

Member Function Documentation

static void igtl::LightObject::BreakOnError ( )
static

This method is called when igtlExceptionMacro executes. It allows the debugger to break on error.

virtual Pointer igtl::LightObject::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented in igtl::Object.

virtual void igtl::LightObject::Delete ( )
virtual

Delete an igtl object. This method should always be used to delete an object when the new operator was used to create it. Using the C delete method will not work with reference counting.

virtual const char* igtl::LightObject::GetNameOfClass ( ) const
inlinevirtual

Return the name of this class as a string. Used by the object factory (implemented in New()) to instantiate objects of a named type. Also used for debugging and other output information.

Definition at line 84 of file igtlLightObject.h.

virtual int igtl::LightObject::GetReferenceCount ( ) const
inlinevirtual

Gets the reference count on this object.

Definition at line 110 of file igtlLightObject.h.

static Pointer igtl::LightObject::New ( )
static

Method for creation through the object factory.

void igtl::LightObject::Print ( std::ostream &  os) const

Cause the object to print itself out.

virtual void igtl::LightObject::PrintHeader ( std::ostream &  os) const
protectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

virtual void igtl::LightObject::PrintSelf ( std::ostream &  os) const
protectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented in igtl::MultiThreader, igtl::Object, igtl::MutexLock, igtl::ObjectFactoryBase, igtl::Socket, igtl::FastMutexLock, igtl::TimeStamp, igtl::ServerSocket, and igtl::ClientSocket.

virtual void igtl::LightObject::PrintTrailer ( std::ostream &  os) const
protectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

virtual void igtl::LightObject::Register ( ) const
virtual

Increase the reference count (mark as used by another object).

Reimplemented in igtl::Object.

virtual void igtl::LightObject::SetReferenceCount ( int  )
virtual

Sets the reference count on this object. This is a dangerous method, use it with care.

Reimplemented in igtl::Object.

virtual void igtl::LightObject::UnRegister ( ) const
virtual

Decrease the reference count (release by another object).

Reimplemented in igtl::Object.

Member Data Documentation

volatile int igtl::LightObject::m_ReferenceCount
mutableprotected

Number of uses of this object by other objects.

Definition at line 131 of file igtlLightObject.h.

SimpleFastMutexLock igtl::LightObject::m_ReferenceCountLock
mutableprotected

Mutex lock to protect modification to the reference count

Definition at line 134 of file igtlLightObject.h.


The documentation for this class was generated from the following file:

Generated at Mon Dec 23 2019 00:49:27 for OpenIGTLink by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2012