|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <VariableMap.h>
Public Member Functions | |
| VariableMap () | |
| The Standard constructor. | |
| ~VariableMap () | |
| The Standard destructor. | |
| void | AddVariable (const std::string &varname, const Variant &val) |
| Variant | RetrieveValue (const std::string &varname) |
| bool | Exists (const std::string &varname) |
| void | Erase (const std::string &varname) |
| void | DumpValues () |
| void | Destroy () |
This is the primary structure for holding variables: the variable map It is an STL map that takes a string-based variable name and stores a variant. Every instance of an Evaluator has one private local VariableMap that cannot be accessed by other Evaluators, and there is on global VariableMap that is shared between Evaluators.
Definition at line 42 of file VariableMap.h.
| VariableMap::VariableMap | ( | ) |
The Standard constructor.
Definition at line 46 of file VariableMap.cpp.
| VariableMap::~VariableMap | ( | ) |
The Standard destructor.
Definition at line 53 of file VariableMap.cpp.
| void VariableMap::AddVariable | ( | const std::string & | varname, |
| const Variant & | val | ||
| ) |
This method will add a new variable with name varname and value val to the variable map, or (if it already exists) change its value to val.
Definition at line 84 of file VariableMap.cpp.
References PEBLUtility::ToUpper().
Referenced by Evaluator::Evaluate(), Evaluator::Evaluate1(), extra(), PlatformWindow::Initialize(), PEventLoop::Loop(), PEventLoop::Loop1(), main(), main(), PEBLInterpret(), PlatformEventQueue::Prime(), and PlatformWindow::Resize().
| void VariableMap::Destroy | ( | ) |
Definition at line 73 of file VariableMap.cpp.
Referenced by CaptureSignal(), and PEBLInterpret().
| void VariableMap::DumpValues | ( | ) |
This method is primarily for debugging purposes. It will iterate through the entire variable map, and Display each of the values held in the map.
Definition at line 162 of file VariableMap.cpp.
| void VariableMap::Erase | ( | const std::string & | varname | ) |
This will erase the value stored in varname
Definition at line 150 of file VariableMap.cpp.
References PEBLUtility::ToUpper().
Referenced by extra().
| bool VariableMap::Exists | ( | const std::string & | varname | ) |
Definition at line 138 of file VariableMap.cpp.
References PEBLUtility::ToUpper().
Referenced by PlatformWindow::Initialize(), and Evaluator::IsVariableName().
| Variant VariableMap::RetrieveValue | ( | const std::string & | varname | ) |
This method will retrieve the value designated by varname. If varname doesn't exist, it will return 0, along with a warning.
Definition at line 113 of file VariableMap.cpp.
References PError::SignalFatalError(), and PEBLUtility::ToUpper().
Referenced by Evaluator::Evaluate(), Evaluator::Evaluate(), Evaluator::Evaluate1(), Evaluator::Evaluate1(), extra(), PlatformWindow::Initialize(), PEventLoop::Loop(), main(), PEBLObjects::MakeTextBox(), PEBLObjects::MakeWindow(), and PlatformWindow::Resize().