Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
Medical Imaging Interaction Toolkit
berry::State Class Reference

#include <berryState.h>

Inheritance diagram for berry::State:
Collaboration diagram for berry::State:

Public Member Functions

 berryObjectMacro (State)
virtual void AddListener (IStateListener *listener)
void AddListener (const IStateListener::Events::StateEvent::AbstractDelegate &delegate)
QString GetId () const
virtual Object::Pointer GetValue () const
virtual void RemoveListener (IStateListener *listener)
void RemoveListener (const IStateListener::Events::StateEvent::AbstractDelegate &delegate)
virtual void SetId (const QString &id)
virtual void SetValue (const Object::Pointer &value)
- Public Member Functions inherited from berry::Object
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

Protected Member Functions

void FireStateChanged (const Object::Pointer &oldValue)
- Protected Member Functions inherited from berry::Object
 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

IStateListener::Events stateEvents
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
QMutex m_ReferenceCountLock

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
typedef berry::SmartPointer< SelfPointer
typedef berry::SmartPointer< const SelfConstPointer
typedef berry::WeakPointer< SelfWeakPtr
typedef berry::WeakPointer< const SelfConstWeakPtr
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
static Reflection::TypeInfo GetStaticTypeInfo ()
static QList< Reflection::TypeInfoGetStaticSuperclasses ()

Detailed Description

A piece of state information that can be shared between objects, and might be persisted between sessions. This can be used for commands that toggle between two states and wish to pass this state information between different handlers.

This state object can either be used as a single state object shared between several commands, or one state object per command – depending on the needs of the application.

Clients may instantiate or extend this class.


Definition at line 42 of file berryState.h.

Member Function Documentation

◆ AddListener() [1/2]

virtual void berry::State::AddListener ( IStateListener listener)

Adds a listener to changes for this state.

listenerThe listener to add; must not be null.

◆ AddListener() [2/2]

void berry::State::AddListener ( const IStateListener::Events::StateEvent::AbstractDelegate delegate)

◆ berryObjectMacro()

berry::State::berryObjectMacro ( State  )

◆ FireStateChanged()

void berry::State::FireStateChanged ( const Object::Pointer oldValue)

Notifies listeners to this state that it has changed in some way.

oldValueThe old value; may be anything.

◆ GetId()

QString berry::State::GetId ( ) const

Returns the identifier for this state.

The id; may be null.

◆ GetValue()

virtual Object::Pointer berry::State::GetValue ( ) const

The current value associated with this state. This can be any type of object, but implementations will usually restrict this value to a particular type.

The current value; may be anything.

◆ RemoveListener() [1/2]

virtual void berry::State::RemoveListener ( IStateListener listener)

Removes a listener to changes from this state.

listenerThe listener to remove; must not be null.

◆ RemoveListener() [2/2]

void berry::State::RemoveListener ( const IStateListener::Events::StateEvent::AbstractDelegate delegate)

◆ SetId()

virtual void berry::State::SetId ( const QString &  id)

Sets the identifier for this object. This method should only be called by the command framework. Clients should not call this method.

idThe id; must not be null.

◆ SetValue()

virtual void berry::State::SetValue ( const Object::Pointer value)

Sets the value for this state object.

valueThe value to set; may be anything.

Member Data Documentation

◆ stateEvents

IStateListener::Events berry::State::stateEvents

Definition at line 113 of file berryState.h.

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