Medical Imaging Interaction Toolkit  2021.02.99-89548602
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
 berryObjectMacro (berry::IEvaluationContext)
 
 ~IEvaluationContext () 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 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 ()
 
- Static Public Attributes inherited from berry::IEvaluationContext
static Object::ConstPointer UNDEFINED_VARIABLE
 
- 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 37 of file berryEvaluationContext.h.

Constructor & Destructor Documentation

◆ EvaluationContext() [1/2]

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

◆ EvaluationContext() [2/2]

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

Member Function Documentation

◆ AddVariable()

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.

◆ GetAllowPluginActivation()

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

Returns whether this evaluation context supports plug-in activation. If not set via SetAllowPluginActivation 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.

◆ GetDefaultVariable()

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.

◆ GetParent()

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.

◆ GetRoot()

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

Returns the root evaluation context.

Returns
the root evaluation context

Implements berry::IEvaluationContext.

◆ GetVariable()

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.

◆ RemoveVariable()

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.

◆ ResolveVariable()

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.

◆ SetAllowPluginActivation()

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.


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