Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryState.h>
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::TypeInfo > | GetSuperclasses () 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< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
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 46 of file berryState.h.
|
virtual |
Adds a listener to changes for this state.
listener | The listener to add; must not be null . |
Definition at line 22 of file berryState.cpp.
References berry::IStateListener::Events::AddListener(), and stateEvents.
void berry::State::AddListener | ( | const IStateListener::Events::StateEvent::AbstractDelegate & | delegate | ) |
Definition at line 27 of file berryState.cpp.
References berry::Message2< T, U, A >::AddListener(), berry::IStateListener::Events::stateChanged, and stateEvents.
berry::State::berryObjectMacro | ( | State | ) |
|
protected |
Notifies listeners to this state that it has changed in some way.
oldValue | The old value; may be anything. |
Definition at line 42 of file berryState.cpp.
References berry::IStateListener::Events::stateChanged, and stateEvents.
Referenced by SetValue().
QString berry::State::GetId | ( | ) | const |
Returns the identifier for this state.
null
. Definition at line 47 of file berryState.cpp.
|
virtual |
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.
Definition at line 52 of file berryState.cpp.
|
virtual |
Removes a listener to changes from this state.
listener | The listener to remove; must not be null . |
Definition at line 32 of file berryState.cpp.
References berry::IStateListener::Events::RemoveListener(), and stateEvents.
void berry::State::RemoveListener | ( | const IStateListener::Events::StateEvent::AbstractDelegate & | delegate | ) |
Definition at line 37 of file berryState.cpp.
References berry::Message2< T, U, A >::RemoveListener(), berry::IStateListener::Events::stateChanged, and stateEvents.
|
virtual |
Sets the identifier for this object. This method should only be called by the command framework. Clients should not call this method.
id | The id; must not be null . |
Definition at line 57 of file berryState.cpp.
|
virtual |
Sets the value for this state object.
value | The value to set; may be anything. |
Definition at line 62 of file berryState.cpp.
References FireStateChanged().
|
protected |
Definition at line 117 of file berryState.h.
Referenced by AddListener(), FireStateChanged(), and RemoveListener().