Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::Object Class Reference

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

#include <berryObject.h>

Inherited by berry::AbstractBitSetEvent [virtual], berry::AbstractContributionFactory, berry::ActionBarAdvisor, berry::CallHistory, berry::CommandContributionItemParameter [virtual], berry::CommandManagerEvent, berry::ElementHandler, berry::EvaluationResult, berry::ExecutionEvent, berry::Expression, berry::GuiTk::Event, berry::GuiTk::IControlListener [virtual], berry::GuiTk::ISelectionListener [virtual], berry::HandleObject [virtual], berry::IActionBarConfigurer, berry::IActionBars, berry::IAdapterManager, berry::IConfigurationElement [virtual], berry::IContributionItem [virtual], berry::IContributionManager [virtual], berry::IContributionManagerOverrides [virtual], berry::IContributionRoot, berry::IContributor, berry::ICountable, berry::IDisposable [virtual], berry::IEditorInput [virtual], berry::IEditorMatchingStrategy, berry::IElementReference, berry::IElementUpdater [virtual], berry::IEvaluationContext, berry::IExtension [virtual], berry::IExtensionPoint [virtual], berry::IFileEditorMapping, berry::IHandler [virtual], berry::IIntroPart [virtual], berry::IIterable, berry::IJobChangeEvent, berry::IJobManager, berry::ILock, berry::IMemento, berry::INestable [virtual], berry::IntroContentDetector, berry::IObjectWithState [virtual], berry::IPageLayout, berry::IParameter [virtual], berry::IPerspectiveDescriptor [virtual], berry::IPerspectiveFactory, berry::IPlaceholderFolderLayout, berry::IPluginContribution [virtual], berry::IPreferencePage [virtual], berry::IPreferences [virtual], berry::IPresentablePart, berry::IProduct [virtual], berry::IProgressMonitor, berry::IPropertyTester, berry::ISafeRunnable, berry::ISafeRunnableRunner, berry::ISaveablePart [virtual], berry::ISaveablesLifecycleListener [virtual], berry::ISaveablesSource [virtual], berry::ISchedulingRule, berry::ISelection, berry::ISelectionProvider [virtual], berry::IServiceLocator [virtual], berry::IShellProvider [virtual], berry::IShowInSource [virtual], berry::IShowInTarget [virtual], berry::ISourceProvider [virtual], berry::ISourceProviderService [virtual], berry::IStackPresentationSite, berry::IStatus, berry::IStickyViewDescriptor, berry::ITestDescriptor, berry::ITypedParameter [virtual], berry::IViewCategory [virtual], berry::IViewLayout, berry::IWorkbenchConfigurer, berry::IWorkbenchPage, berry::IWorkbenchPart [virtual], berry::IWorkbenchPartDescriptor [virtual], berry::IWorkbenchPartReference, berry::IWorkbenchWindow [virtual], berry::IWorkbenchWindowConfigurer, berry::LockListener, berry::ObjectGeneric< T >, berry::ObjectList< T >, berry::ObjectString, berry::ObjectStringMap, berry::ObjectTypeInfo, berry::ParameterizedCommand, berry::PlatformObject [virtual], berry::ProgressProvider, berry::PropertyChangeEvent, berry::QModelIndexObject, berry::Saveable [virtual], berry::SaveablesLifecycleEvent, berry::SelectionChangedEvent, berry::Shell [virtual], berry::ShellEvent, berry::ShowInContext [virtual], berry::StackDropResult, berry::StackPresentation, berry::State, berry::UIElement, berry::UndefinedVariable, berry::Window::IExceptionHandler, IChangeText [virtual], mitk::DataNodeObject, mitk::IDataStorageReference, mitk::IInputDevice, mitk::IInputDeviceDescriptor, mitk::MAPAlgorithmInfoObject, berry::ObjectGeneric< bool >, berry::ObjectGeneric< double >, berry::ObjectGeneric< float >, and berry::ObjectGeneric< int >.

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 78 of file berryObject.h.

Member Typedef Documentation

Definition at line 89 of file berryObject.h.

Definition at line 91 of file berryObject.h.

Definition at line 88 of file berryObject.h.

Definition at line 87 of file berryObject.h.

Definition at line 90 of file berryObject.h.

Constructor & Destructor Documentation

berry::Object::Object ( )
protected

Definition at line 167 of file berryObject.cpp.

References berry::DebugUtil::RegisterObject().

berry::Object::~Object ( )
protectedvirtual

warn user if reference counting is on and the object is being referenced by another object.

notifies the registered functions that the object is being destroyed

Definition at line 177 of file berryObject.cpp.

References BERRY_WARN, GetClassName(), m_ReferenceCount, berry::Message< A >::Send(), and berry::DebugUtil::UnregisterObject().

Member Function Documentation

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

Definition at line 159 of file berryObject.h.

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.

Definition at line 35 of file berryObject.cpp.

References UnRegister().

QString berry::Object::GetClassName ( ) const
virtual
int berry::Object::GetReferenceCount ( ) const
inline

Gets the reference count on this object.

Definition at line 150 of file berryObject.h.

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

Definition at line 70 of file berryObject.cpp.

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

Definition at line 90 of file berryObject.cpp.

Referenced by GetSuperclasses().

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

Definition at line 80 of file berryObject.cpp.

Referenced by GetTypeInfo().

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

Reimplemented in berry::ObjectTypeInfo.

Definition at line 95 of file berryObject.cpp.

References GetStaticSuperclasses().

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

Reimplemented in berry::ObjectTypeInfo.

Definition at line 85 of file berryObject.cpp.

References GetStaticTypeInfo().

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.

Definition at line 115 of file berryObject.cpp.

References qHash().

Referenced by qHash().

bool berry::Object::operator< ( const Object o) 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.

Definition at line 120 of file berryObject.cpp.

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.

Definition at line 100 of file berryObject.cpp.

References berry::Indent::GetNextIndent(), PrintHeader(), PrintSelf(), and PrintTrailer().

Referenced by operator<<(), and ToString().

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

Define a default print header for all objects.

Definition at line 216 of file berryObject.cpp.

References GetClassName().

Referenced by Print().

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.

Definition at line 205 of file berryObject.cpp.

References berry::Reflection::DemangleName(), and m_ReferenceCount.

Referenced by Print().

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

Define a default print trailer for all objects.

Definition at line 225 of file berryObject.cpp.

Referenced by Print().

void berry::Object::Register ( ) const

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

Definition at line 125 of file berryObject.cpp.

References m_ReferenceCount.

Referenced by QmitkExtActionBarAdvisor::MakeActions(), QmitkAbstractView::~QmitkAbstractView(), and QmitkFunctionality::~QmitkFunctionality().

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

Definition at line 161 of file berryObject.h.

void berry::Object::SetReferenceCount ( int  ref)

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

Definition at line 138 of file berryObject.cpp.

References m_ReferenceCount, and m_ReferenceCountLock.

QString berry::Object::ToString ( ) const
virtual
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!)

Definition at line 130 of file berryObject.cpp.

References m_ReferenceCount.

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

Member Data Documentation

QAtomicInt berry::Object::m_ReferenceCount
mutableprotected

Number of uses of this object by other objects.

Definition at line 197 of file berryObject.h.

Referenced by PrintSelf(), Register(), SetReferenceCount(), UnRegister(), and ~Object().

QMutex berry::Object::m_ReferenceCountLock
mutableprotected

Mutex lock to protect modification to the reference count

Definition at line 200 of file berryObject.h.

Referenced by SetReferenceCount().


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