SeExpr

Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SeExpr2::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. More...
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. More...
Context * | createChildContext () const
| Create a context that is a child of this context. More...
void | setParent (const Context *context)
const Context * | getParent () const
bool | hasContext (const Context *context) const

## Static Public Member Functions
static Context & | global ()
| The global default context of the seexpr. More...

## Private Types
typedef std::map< std::string, std::string > | ParameterMap

## Private Member Functions
| Context (const Context &)
Context & | operator= (const Context &)
| Context (const Context *parent)

## Private Attributes
const Context * | _parent
| The parent scope. More...
ParameterMap | _parameters
| Attribute/value pairs. More...

## Detailed Description

Definition at line 24 of file Context.h.

## Member Typedef Documentation

## ◆ ParameterMap

typedef std::map<std::string, std::string> SeExpr2::Context::ParameterMap
| private

Definition at line 66 of file Context.h.

## Constructor & Destructor Documentation

## ◆ Context() [1/2]

SeExpr2::Context::Context | ( | const Context & |  | ) |
| private

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

Referenced by createChildContext().

## ◆ Context() [2/2]

Context::Context | ( | const Context * | parent | ) |
| private

Definition at line 21 of file Context.cpp.

## Member Function Documentation

## ◆ createChildContext()

Context * Context::createChildContext | ( |  | ) | const

Create a context that is a child of this context.

Definition at line 27 of file Context.cpp.

References Context().

## ◆ getParent()

const Context* SeExpr2::Context::getParent | ( |  | ) | const
| inline

Definition at line 44 of file Context.h.

References _parent.

## ◆ global()

Context & Context::global | ( |  | ) |
| static

The global default context of the seexpr.

Definition at line 29 of file Context.cpp.

References context.

## ◆ hasContext()

bool SeExpr2::Context::hasContext | ( | const Context * | context | ) | const
| inline

Definition at line 46 of file Context.h.

References _parent, context, and hasContext().

Referenced by hasContext().

## ◆ lookupParameter()

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

Lookup a Context parameter by name.

Definition at line 27 of file Context.h.

References _parameters, _parent, it, lookupParameter(), and value().

Referenced by lookupParameter().

## ◆ operator=()

Context& SeExpr2::Context::operator= | ( | const Context & |  | ) |
| private

## ◆ 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 23 of file Context.cpp.

References _parameters, and value().

## ◆ setParent()

void SeExpr2::Context::setParent | ( | const Context * | context | ) |
| inline

Definition at line 43 of file Context.h.

References _parent, and context.

## Member Data Documentation

## ◆ _parameters

ParameterMap SeExpr2::Context::_parameters
| private

Attribute/value pairs.

Definition at line 68 of file Context.h.

Referenced by lookupParameter(), and setParameter().

## ◆ _parent

const Context* SeExpr2::Context::_parent
| private

The parent scope.

Definition at line 63 of file Context.h.

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

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

- /build/seexpr/src/SeExpr/src/SeExpr2/Context.h
- /build/seexpr/src/SeExpr/src/SeExpr2/Context.cpp