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

#include <berryEvaluationContext.h>

Inheritance diagram for berry::EvaluationContext:
Collaboration diagram for berry::EvaluationContext:

Public Member Functions

 EvaluationContext (IEvaluationContext *parent, const Object::ConstPointer &defaultVariable)
 
 EvaluationContext (IEvaluationContext *parent, const Object::ConstPointer &defaultVariable, const std::vector< IVariableResolver * > &resolvers)
 
IEvaluationContextGetParent () const override
 
IEvaluationContextGetRoot () const override
 
Object::ConstPointer GetDefaultVariable () const override
 
void SetAllowPluginActivation (bool value) override
 
bool GetAllowPluginActivation () const override
 
void AddVariable (const QString &name, const Object::ConstPointer &value) override
 
Object::ConstPointer RemoveVariable (const QString &name) override
 
Object::ConstPointer GetVariable (const QString &name) const override
 
Object::ConstPointer ResolveVariable (const QString &name, const QList< Object::Pointer > &args) const override
 
- Public Member Functions inherited from berry::IEvaluationContext
virtual berryObjectMacro(berry::IEvaluationContext) static Object ~IEvaluationContext ()
 
- 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
 

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 ()
 
- 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

A default implementation of an evaluation context.

Clients may instantiate this default context. The class is not intended to be subclassed by clients.

Since
3.0

Definition at line 41 of file berryEvaluationContext.h.

Constructor & Destructor Documentation

berry::EvaluationContext::EvaluationContext ( IEvaluationContext parent,
const Object::ConstPointer defaultVariable 
)

Create a new evaluation context with the given parent and default variable.

Parameters
parentthe parent context. Can be null.
defaultVariablethe default variable

Definition at line 21 of file berryEvaluationContext.cpp.

berry::EvaluationContext::EvaluationContext ( IEvaluationContext parent,
const Object::ConstPointer defaultVariable,
const std::vector< IVariableResolver * > &  resolvers 
)

Create a new evaluation context with the given parent and default variable.

Parameters
parentthe parent context. Can be null.
defaultVariablethe default variable
resolversan array of IVariableResolvers to resolve additional variables.
See also
#resolveVariable(String, Object[])

Definition at line 28 of file berryEvaluationContext.cpp.

Member Function Documentation

void berry::EvaluationContext::AddVariable ( const QString &  name,
const Object::ConstPointer value 
)
overridevirtual

Adds a new named variable to this context. If a variable with the name already exists the new one overrides the existing one.

Parameters
namethe variable's name
valuethe variable's value

Implements berry::IEvaluationContext.

Definition at line 74 of file berryEvaluationContext.cpp.

References berry::SmartPointer< TObjectType >::IsNotNull().

bool berry::EvaluationContext::GetAllowPluginActivation ( ) const
overridevirtual

Returns whether this evaluation context supports plug-in activation. If not set via setAllowPluginActivation(boolean) the parent value is returned. If no parent is set false is returned.

Returns
whether plug-in activation is supported or not
Since
3.2

Implements berry::IEvaluationContext.

Definition at line 60 of file berryEvaluationContext.cpp.

References berry::IEvaluationContext::GetAllowPluginActivation().

Object::ConstPointer berry::EvaluationContext::GetDefaultVariable ( ) const
overridevirtual

Returns the default variable.

Returns
the default variable or null if no default variable is managed.

Implements berry::IEvaluationContext.

Definition at line 50 of file berryEvaluationContext.cpp.

IEvaluationContext * berry::EvaluationContext::GetParent ( ) const
overridevirtual

Returns the parent context or null if this is the root of the evaluation context hierarchy.

Returns
the parent evaluation context or null

Implements berry::IEvaluationContext.

Definition at line 38 of file berryEvaluationContext.cpp.

IEvaluationContext * berry::EvaluationContext::GetRoot ( ) const
overridevirtual

Returns the root evaluation context.

Returns
the root evaluation context

Implements berry::IEvaluationContext.

Definition at line 43 of file berryEvaluationContext.cpp.

References berry::IEvaluationContext::GetRoot().

Object::ConstPointer berry::EvaluationContext::GetVariable ( const QString &  name) const
overridevirtual

Returns the variable managed under the given name.

Parameters
namethe variable's name
Returns
the variable's value or null if the content doesn't manage a variable with the given name

Implements berry::IEvaluationContext.

Definition at line 93 of file berryEvaluationContext.cpp.

References berry::IEvaluationContext::GetVariable().

Object::ConstPointer berry::EvaluationContext::RemoveVariable ( const QString &  name)
overridevirtual

Removes the variable managed under the given name from this evaluation context.

Parameters
namethe variable's name
Returns
the currently stored value or null if the variable doesn't exist

Implements berry::IEvaluationContext.

Definition at line 83 of file berryEvaluationContext.cpp.

Object::ConstPointer berry::EvaluationContext::ResolveVariable ( const QString &  name,
const QList< Object::Pointer > &  args 
) const
overridevirtual

Resolves a variable for the given name and arguments. This method can be used to dynamically resolve variable such as plug-in descriptors, resources, etc. The method is used by the resolve expression.

Parameters
namethe variable to resolve
argsan object array of arguments used to resolve the variable
Returns
the variable's value or null if no variable can be resolved for the given name and arguments
Exceptions
CoreExceptionif an errors occurs while resolving the variable

Implements berry::IEvaluationContext.

Definition at line 115 of file berryEvaluationContext.cpp.

References berry::IVariableResolver::Resolve(), and berry::IEvaluationContext::ResolveVariable().

void berry::EvaluationContext::SetAllowPluginActivation ( bool  value)
overridevirtual

Specifies whether this evaluation context allows activation of plug-ins for testers used in the expression tree. To actual trigger the plug-in loading this flag has to be set to true and the actual test expression must have the attribute forcePluginActivation set to true as well.

Parameters
valuewhether this evaluation context allows plug-in activation
Since
3.2

Implements berry::IEvaluationContext.

Definition at line 55 of file berryEvaluationContext.cpp.


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