Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

igtl::LightObject Class Reference

Light weight base class for most igtl classes. More...

#include <igtlLightObject.h>

Inheritance diagram for igtl::LightObject:
igtl::ConditionVariable igtl::Object igtl::CreateObjectFunctionBase igtl::FastMutexLock igtl::MessageBase igtl::MultiThreader igtl::MutexLock igtl::ObjectFactoryBase igtl::Socket igtl::TimeStamp

List of all members.

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 PrintHeader (std::ostream &os) const
virtual void PrintSelf (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 60 of file igtlLightObject.h.


Member Typedef Documentation


Constructor & Destructor Documentation

igtl::LightObject::LightObject (  )  [inline, protected]

Definition at line 120 of file igtlLightObject.h.

virtual igtl::LightObject::~LightObject (  )  [protected, virtual]

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 [inline, virtual]

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 86 of file igtlLightObject.h.

virtual int igtl::LightObject::GetReferenceCount (  )  const [inline, virtual]

Gets the reference count on this object.

Definition at line 112 of file igtlLightObject.h.

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

Method for creation through the object factory.

Reimplemented in igtl::Object.

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

Cause the object to print itself out.

virtual void igtl::LightObject::PrintHeader ( std::ostream &  os  )  const [protected, virtual]

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 [protected, virtual]

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::FastMutexLock, igtl::MutexLock, igtl::Object, igtl::ObjectFactoryBase, and igtl::TimeStamp.

virtual void igtl::LightObject::PrintTrailer ( std::ostream &  os  )  const [protected, virtual]

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 [mutable, protected]

Number of uses of this object by other objects.

Definition at line 133 of file igtlLightObject.h.

Mutex lock to protect modification to the reference count

Definition at line 136 of file igtlLightObject.h.


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

Generated at Tue May 11 19:42:19 2010 for OpenIGTLink by doxygen 1.6.3 written by Dimitri van Heesch, © 1997-2000