Light weight base class for most igtl classes. More...
#include <igtlLightObject.h>
Public Types | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
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 |
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).
Definition at line 60 of file igtlLightObject.h.
typedef SmartPointer<const Self> igtl::LightObject::ConstPointer |
Reimplemented in igtl::ClientSocket, igtl::ConditionVariable, igtl::CreateObjectFunctionBase, igtl::FastMutexLock, igtl::ImageMessage, igtl::MessageBase, igtl::MultiThreader, igtl::MutexLock, igtl::Object, igtl::ObjectFactoryBase, igtl::PositionMessage, igtl::ServerSocket, igtl::Socket, igtl::StatusMessage, igtl::TimeStamp, and igtl::TransformMessage.
Definition at line 66 of file igtlLightObject.h.
typedef SmartPointer<Self> igtl::LightObject::Pointer |
Reimplemented in igtl::ClientSocket, igtl::ConditionVariable, igtl::CreateObjectFunctionBase, igtl::CreateObjectFunction< T >, igtl::FastMutexLock, igtl::ImageMessage, igtl::MessageBase, igtl::MultiThreader, igtl::MutexLock, igtl::Object, igtl::ObjectFactoryBase, igtl::PositionMessage, igtl::ServerSocket, igtl::Socket, igtl::StatusMessage, igtl::TimeStamp, and igtl::TransformMessage.
Definition at line 65 of file igtlLightObject.h.
typedef LightObject igtl::LightObject::Self |
Standard clas typedefs.
Reimplemented in igtl::ClientSocket, igtl::ConditionVariable, igtl::CreateObjectFunctionBase, igtl::CreateObjectFunction< T >, igtl::FastMutexLock, igtl::ImageMessage, igtl::MessageBase, igtl::MultiThreader, igtl::MutexLock, igtl::Object, igtl::ObjectFactoryBase, igtl::PositionMessage, igtl::ServerSocket, igtl::Socket, igtl::StatusMessage, igtl::TimeStamp, and igtl::TransformMessage.
Definition at line 64 of file igtlLightObject.h.
igtl::LightObject::LightObject | ( | ) | [inline, protected] |
Definition at line 120 of file igtlLightObject.h.
virtual igtl::LightObject::~LightObject | ( | ) | [protected, virtual] |
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] |
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] |
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.
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.
SimpleFastMutexLock igtl::LightObject::m_ReferenceCountLock [mutable, protected] |
Mutex lock to protect modification to the reference count
Definition at line 136 of file igtlLightObject.h.