Medical Imaging Interaction Toolkit  2018.04.99-c3229764
Medical Imaging Interaction Toolkit
berry::Object Class Reference

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

#include <berryObject.h>

Inheritance diagram for berry::Object:

Public Types

typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 

Public Member Functions

virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Static Public Member Functions

static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 

Protected Member Functions

 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 

Protected Attributes

QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

Light weight base class for most BlueBerry classes.

Object is copied from itk::LightObject and is the highest level base class for most BlueBerry objects. It implements reference counting and the API for object printing.

Definition at line 72 of file berryObject.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 83 of file berryObject.h.

◆ ConstWeakPtr

Definition at line 85 of file berryObject.h.

◆ Pointer

Definition at line 82 of file berryObject.h.

◆ Self

Definition at line 81 of file berryObject.h.

◆ WeakPtr

Definition at line 84 of file berryObject.h.

Constructor & Destructor Documentation

◆ Object()

berry::Object::Object ( )
protected

◆ ~Object()

virtual berry::Object::~Object ( )
protectedvirtual

Member Function Documentation

◆ AddDestroyListener()

void berry::Object::AddDestroyListener ( const MessageAbstractDelegate<> &  delegate) const
inline

Definition at line 153 of file berryObject.h.

◆ Delete()

virtual void berry::Object::Delete ( )
virtual

Delete an BlueBerry 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.

◆ GetClassName()

virtual QString berry::Object::GetClassName ( ) const
virtual

◆ GetReferenceCount()

int berry::Object::GetReferenceCount ( ) const
inline

Gets the reference count on this object.

Definition at line 144 of file berryObject.h.

◆ GetStaticClassName()

static const char* berry::Object::GetStaticClassName ( )
static

◆ GetStaticSuperclasses()

static QList<Reflection::TypeInfo> berry::Object::GetStaticSuperclasses ( )
static

◆ GetStaticTypeInfo()

static Reflection::TypeInfo berry::Object::GetStaticTypeInfo ( )
static

◆ GetSuperclasses()

virtual QList<Reflection::TypeInfo> berry::Object::GetSuperclasses ( ) const
virtual

Reimplemented in berry::ObjectTypeInfo.

◆ GetTypeInfo()

virtual Reflection::TypeInfo berry::Object::GetTypeInfo ( ) const
virtual

Reimplemented in berry::ObjectTypeInfo.

◆ HashCode()

virtual uint berry::Object::HashCode ( ) const
virtual

Returns a hash code value for the object.

Reimplemented in berry::Saveable, berry::ParameterizedCommand, berry::Expression, berry::HandleObject, and berry::QActionContributionItem.

◆ operator<()

virtual bool berry::Object::operator< ( const Object ) const
virtual

Override this method to implement a specific "less than" operator for associative STL containers.

Reimplemented in berry::Command, berry::Saveable, berry::ParameterizedCommand, and berry::ParameterType.

◆ operator==()

◆ Print()

QDebug berry::Object::Print ( QDebug  os,
Indent  Indent = 0 
) const

Cause the object to print itself out. This is usually used to provide detailed information about the object's state. It just calls the header/self/trailer virtual print methods, which can be overriden by subclasses.

◆ PrintHeader()

virtual QDebug berry::Object::PrintHeader ( QDebug  os,
Indent  indent 
) const
protectedvirtual

◆ PrintSelf()

virtual QDebug berry::Object::PrintSelf ( QDebug  os,
Indent  indent 
) 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.

◆ PrintTrailer()

virtual QDebug berry::Object::PrintTrailer ( QDebug  os,
Indent  indent 
) const
protectedvirtual

◆ Register()

void berry::Object::Register ( ) const

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

Referenced by berry::SmartPointer< berry::MenuManager >::operator=().

◆ RemoveDestroyListener()

void berry::Object::RemoveDestroyListener ( const MessageAbstractDelegate<> &  delegate) const
inline

Definition at line 155 of file berryObject.h.

References mitk::operator==().

◆ SetReferenceCount()

void berry::Object::SetReferenceCount ( int  )

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

◆ ToString()

virtual QString berry::Object::ToString ( ) const
virtual

◆ UnRegister()

void berry::Object::UnRegister ( bool  del = true) const

Decrease the reference count (release by another object). Set del to false if you do not want the object to be deleted if the reference count is zero (use with care!)

Referenced by berry::QScopedPointerObjectDeleter::cleanup(), and berry::SmartPointer< berry::MenuManager >::operator=().

Member Data Documentation

◆ m_ReferenceCount

QAtomicInt berry::Object::m_ReferenceCount
mutableprotected

Number of uses of this object by other objects.

Definition at line 191 of file berryObject.h.

◆ m_ReferenceCountLock

QMutex berry::Object::m_ReferenceCountLock
mutableprotected

Mutex lock to protect modification to the reference count

Definition at line 194 of file berryObject.h.


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