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

#include <berryExecutionEvent.h>

Inheritance diagram for berry::ExecutionEvent:
Collaboration diagram for berry::ExecutionEvent:

Public Types

typedef QHash< QString, QString > ParameterMap
 
- 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
 

Public Member Functions

 berryObjectMacro (ExecutionEvent)
 
 ExecutionEvent ()
 
 ExecutionEvent (const Command::ConstPointer &command, const ParameterMap &parameters, const Object::ConstPointer &trigger, const Object::Pointer &applicationContext)
 
const Object::Pointer GetApplicationContext () const
 
const Command::ConstPointer GetCommand () const
 
const Object::ConstPointer GetObjectParameterForExecution (const QString &parameterId) const
 
QString GetParameter (const QString &parameterId) const
 
const ParameterMapGetParameters () const
 
const Object::ConstPointer GetTrigger () const
 
QString ToString () const override
 
- 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 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
 

Additional Inherited Members

- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- 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 inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

The data object to pass to the command (and its handler) as it executes. This carries information about the current state of the application, and the application context in which the command was executed.

An execution event carries three blocks of data: the parameters, the trigger, and the application context. How these blocks are used is application dependent. In the BlueBerry workbench, the trigger is an SWT event, and the application context contains information about the selection and active part.

Definition at line 41 of file berryExecutionEvent.h.

Member Typedef Documentation

typedef QHash<QString, QString> berry::ExecutionEvent::ParameterMap

Definition at line 47 of file berryExecutionEvent.h.

Constructor & Destructor Documentation

berry::ExecutionEvent::ExecutionEvent ( )

Constructs a new instance of ExecutionEvent with no parameters, no trigger and no application context. This is just a convenience method.

Definition at line 32 of file berryExecutionEvent.cpp.

berry::ExecutionEvent::ExecutionEvent ( const Command::ConstPointer command,
const ParameterMap parameters,
const Object::ConstPointer trigger,
const Object::Pointer applicationContext 
)

Constructs a new instance of ExecutionEvent.

Parameters
commandThe command being executed; may be null.
parametersThe parameters to qualify the execution; must not be null. This must be a map of parameter ids (String) to parameter values (String).
triggerThe object that triggered the execution; may be null.
applicationContextThe state of the application at the time the execution was triggered; may be null.

Definition at line 37 of file berryExecutionEvent.cpp.

Member Function Documentation

berry::ExecutionEvent::berryObjectMacro ( ExecutionEvent  )
const Object::Pointer berry::ExecutionEvent::GetApplicationContext ( ) const

Returns the state of the application at the time the execution was triggered.

Returns
The application context; may be null.

Definition at line 45 of file berryExecutionEvent.cpp.

const Command::ConstPointer berry::ExecutionEvent::GetCommand ( ) const

Returns the command being executed.

Returns
The command being executed.

Definition at line 50 of file berryExecutionEvent.cpp.

const Object::ConstPointer berry::ExecutionEvent::GetObjectParameterForExecution ( const QString &  parameterId) const

Returns the object represented by the string value of the parameter with the provided id.

This is intended to be used in the scope of an IHandler#execute(ExecutionEvent) method, so any problem getting the object value causes ExecutionException to be thrown.

Parameters
parameterIdThe id of a parameter to retrieve the object value of.
Returns
The object value of the parameter with the provided id.
Exceptions
ExecutionExceptionif the parameter object value could not be obtained for any reason

Definition at line 55 of file berryExecutionEvent.cpp.

References GetParameter(), Json::objectValue, and Json::stringValue.

QString berry::ExecutionEvent::GetParameter ( const QString &  parameterId) const

Returns the value of the parameter with the given id.

Parameters
parameterIdThe id of the parameter to retrieve; may be null.
Returns
The parameter value; null if the parameter cannot be found.

Definition at line 97 of file berryExecutionEvent.cpp.

Referenced by GetObjectParameterForExecution().

const ExecutionEvent::ParameterMap & berry::ExecutionEvent::GetParameters ( ) const

Returns all of the parameters.

Returns
The parameters; never null, but may be empty.

Definition at line 105 of file berryExecutionEvent.cpp.

const Object::ConstPointer berry::ExecutionEvent::GetTrigger ( ) const

Returns the object that triggered the execution

Returns
The trigger; null if there was no trigger.

Definition at line 110 of file berryExecutionEvent.cpp.

QString berry::ExecutionEvent::ToString ( ) const
overridevirtual

The string representation of this execution event – for debugging purposes only. This string should not be shown to an end user.

Reimplemented from berry::Object.

Definition at line 115 of file berryExecutionEvent.cpp.


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