KSeExpr 4.0.4.0
KSeExpr::Context Class Reference

#include <Context.h>

Public Member Functions

bool lookupParameter (const std::string &parameterName, std::string &value) const
 Lookup a Context parameter by name.
void setParameter (const std::string &parameterName, const std::string &value)
 Set a parameter. NOTE: this must be done when no threads are accessing lookupParameter for safety.
ContextcreateChildContext () const
 Create a context that is a child of this context.
void setParent (const Context *context)
const ContextgetParent () const
bool hasContext (const Context *context) const
 ~Context ()=default
 Context (const Context &)=delete
 Context (Context &&)=delete
Contextoperator= (const Context &)=delete
Contextoperator= (Context &&)=delete

Static Public Member Functions

static Contextglobal ()
 The global default context of the seexpr.

Private Types

using ParameterMap = std::unordered_map<std::string, std::string>

Private Member Functions

 Context (const Context *parent)

Private Attributes

const Context_parent {nullptr}
 The parent scope.
ParameterMap _parameters
 Attribute/value pairs.

Detailed Description

Definition at line 14 of file Context.h.

Member Typedef Documentation

◆ ParameterMap

using KSeExpr::Context::ParameterMap = std::unordered_map<std::string, std::string>
private

Definition at line 71 of file Context.h.

Constructor & Destructor Documentation

◆ ~Context()

KSeExpr::Context::~Context ( )
default

◆ Context() [1/3]

KSeExpr::Context::Context ( const Context & )
delete

Private constructor and un-implemented default/copy/assignment (it is required that we derive from the global context via createChildContext)

References Context().

Referenced by Context(), Context(), Context(), createChildContext(), getParent(), global(), hasContext(), operator=(), operator=(), and setParent().

◆ Context() [2/3]

KSeExpr::Context::Context ( Context && )
delete

References Context().

◆ Context() [3/3]

Context::Context ( const Context * parent)
private

Definition at line 10 of file Context.cpp.

References _parent, and Context().

Member Function Documentation

◆ createChildContext()

Context * Context::createChildContext ( ) const

Create a context that is a child of this context.

Definition at line 20 of file Context.cpp.

References Context().

◆ getParent()

const Context * KSeExpr::Context::getParent ( ) const
inline

Definition at line 39 of file Context.h.

References _parent, and Context().

◆ global()

Context & Context::global ( )
static

The global default context of the seexpr.

Definition at line 25 of file Context.cpp.

References Context().

◆ hasContext()

bool KSeExpr::Context::hasContext ( const Context * context) const
inline

Definition at line 44 of file Context.h.

References _parent, and Context().

◆ lookupParameter()

bool KSeExpr::Context::lookupParameter ( const std::string & parameterName,
std::string & value ) const
inline

Lookup a Context parameter by name.

Definition at line 18 of file Context.h.

References _parameters, and _parent.

◆ operator=() [1/2]

Context & KSeExpr::Context::operator= ( const Context & )
delete

References Context().

◆ operator=() [2/2]

Context & KSeExpr::Context::operator= ( Context && )
delete

References Context().

◆ setParameter()

void Context::setParameter ( const std::string & parameterName,
const std::string & value )

Set a parameter. NOTE: this must be done when no threads are accessing lookupParameter for safety.

Definition at line 15 of file Context.cpp.

References _parameters.

◆ setParent()

void KSeExpr::Context::setParent ( const Context * context)
inline

Definition at line 35 of file Context.h.

References _parent, and Context().

Member Data Documentation

◆ _parameters

ParameterMap KSeExpr::Context::_parameters
private

Attribute/value pairs.

Definition at line 73 of file Context.h.

Referenced by lookupParameter(), and setParameter().

◆ _parent

const Context* KSeExpr::Context::_parent {nullptr}
private

The parent scope.

Definition at line 69 of file Context.h.

Referenced by Context(), getParent(), hasContext(), lookupParameter(), and setParent().


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