32#ifndef DRAIN_CONTEXT_H_
33#define DRAIN_CONTEXT_H_
42#include "drain/util/Cloner.h"
43#include "drain/util/StatusFlags.h"
44#include "drain/util/VariableMap.h"
47#include "CommandSequence.h"
68 Loop::loopStack loops;
83 long int getId()
const {
88 const std::string & getName()
const {
128 const Variable & getStatus(
const std::string & key,
bool update)
const {
131 return statusMap[key];
139 void setStatus(
const std::string & key,
const T & value){
140 statusMap[key] = value;
159 bool isScriptDefined(){
160 return !routine.empty();
170 const std::string name;
178 void updateStatus()
const;
182 static long int counter;
204 bool expandVariables;
282 contextPtr = & getCloner<C>().get();
294 return (contextPtr !=
nullptr);
303 template <
class T=Context>
306 return (T &)*contextPtr;
311 return getCloner<T>().getSourceOrig();
345 return getCloner<C>();
Utilities.
Definition Context.h:193
std::string formatStr
Definition Context.h:211
virtual const drain::VariableMap & getStatusMap() const
A long description of context variables and other resources.
Definition Context.h:109
StatusFlags statusFlags
Optional log filename (syntax): when defined, automatically opened by CommandBank::run()
Definition Context.h:102
virtual void report(StatusFlags &flags)
Report status. Typically, report final status of a thread to its base context.
Definition Context.h:150
const std::string basename
Used by copy const.
Definition Context.h:166
Contextual(Context &ctx)
Copies internal contextPtr.
Definition Context.h:274
bool contextIsSet() const
True, if contextPtr has been set.
Definition Context.h:293
Contextual(const Contextual &src)
Copies base context (even null) of the source. Notice that the actual instance may be of derived clas...
Definition Context.h:268
T & getContext() const
If context has been set, returns it through a cast to base class Context.
Definition Context.h:304
void setContext()
Sets internal contextPtr to the static source.
Definition Context.h:281
Contextual()
Sets internal contextPtr to NULL.
Definition Context.h:264
void setExternalContext(Context &ctx)
Sets internal contextPtr to outside target.
Definition Context.h:287
Handler for notifications sent by a Logger.
Definition Log.h:147
void set(const V &... args)
Set bits, accepting numeric values or keys.
Definition Flags.h:284
Definition CommandSequence.h:85
Adds class-specific convenience functions.
Definition Context.h:331
A map of Variables.
Definition VariableMap.h:61
Definition DataSelector.cpp:1277
DRAIN_VARIABLE Variable
Value container supporting dynamic type.
Definition Variable.h:63
Wrapper for derived class S, returning base class T.
Definition Cloner.h:118
virtual const S & getSourceOrig() const
Returns a const reference to a default instance, in actual class.
Definition Cloner.h:229