|
WSF
|
#include <WsfVariable.hpp>

Public Member Functions | |
| WsfVariableBase () | |
| bool | HasDefaultValue () const |
| Has a default value been defined for a reference. | |
| bool | IsReference () const |
| Is the variable a reference to a script variable? | |
Protected Member Functions | |
| bool | DefaultOptionPresent (UtInput &aInput) |
| Determine if the '/default' option is present. | |
| std::string | ObjectName (WsfComponent *aObjectPtr) |
| Return the name of the object for messages. | |
| bool | ReadReference (UtInput &aInput) |
| bool | ResolveReference (const std::string &aVariableName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, const UtScriptData *&aRefValuePtr, WsfScriptContext &aGlobalContext) |
Routines for type 'WsfStringId' | |
| WsfStringId | mRefVarNameId |
| The name (ID) of the referenced variable. It is less than zero if the variable is not a reference. | |
| bool | mHasDefaultValue |
| 'true' if the '/default' option was provided | |
| bool | Initialize (const std::string &aName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, WsfStringId &aValue, WsfScriptContext &aGlobalContext) |
| void | ReadValue (UtInput &aInput, WsfStringId &aValue) |
Routines for type 'double' | |
| bool | Initialize (const std::string &aName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, double &aValue, WsfScriptContext &aGlobalContext) |
| void | ReadValue (UtInput &aInput, double &aValue) |
| void | ReadValueOfType (UtInput &aInput, UtInput::ValueType aType, double &aValue) |
Routines for type 'float' | |
| bool | Initialize (const std::string &aName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, float &aValue, WsfScriptContext &aGlobalContext) |
| void | ReadValue (UtInput &aInput, float &aValue) |
| void | ReadValueOfType (UtInput &aInput, UtInput::ValueType aType, float &aValue) |
Routines for type 'int' | |
| bool | Initialize (const std::string &aName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, int &aValue, WsfScriptContext &aGlobalContext) |
| void | ReadValue (UtInput &aInput, int &aValue) |
| void | ReadValueOfType (UtInput &aInput, UtInput::ValueType aType, int &aValue) |
Routines for type 'bool' | |
| bool | Initialize (const std::string &aName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, bool &aValue, WsfScriptContext &aGlobalContext) |
| void | ReadValue (UtInput &aInput, bool &aValue) |
Routines for type 'std::string' | |
| bool | Initialize (const std::string &aName, WsfComponent *aObjectPtr, WsfScriptContext *aContextPtr, std::string &aValue, WsfScriptContext &aGlobalContext) |
| void | ReadValue (UtInput &aInput, std::string &aValue) |
A class which supports defining a variable that can either be a fixed value or a reference to a script variable.
This class is defined so that only minimal changes need to be made to the code to replace a simple scalar variable with one that can get its value from a script variable.
The base class for a variable. This contains:
| WsfVariableBase::WsfVariableBase | ( | ) |
References mHasDefaultValue, and mRefVarNameId.
Referenced by WsfVariable< T >::WsfVariable(), WsfVariable< WsfStringId >::WsfVariable(), and WsfVariable< WsfStringId >::WsfVariable().
|
protected |
Determine if the '/default' option is present.
References mHasDefaultValue.
Referenced by ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValueOfType(), ReadValueOfType(), and ReadValueOfType().
|
inline |
Has a default value been defined for a reference.
References mHasDefaultValue.
Referenced by ResolveReference(), WsfVariable< T >::ValueGreater(), WsfVariable< T >::ValueGreaterOrEqual(), WsfVariable< T >::ValueInClosedRange(), WsfVariable< T >::ValueLess(), and WsfVariable< T >::ValueLessOrEqual().
|
protected |
References ok, and ResolveReference().
|
protected |
References ok, and ResolveReference().
Referenced by WsfVariable< T >::Initialize(), and WsfVariable< WsfStringId >::Initialize().
|
protected |
References ok, and ResolveReference().
|
protected |
References ok, and ResolveReference().
|
protected |
References ok, and ResolveReference().
|
protected |
References ok, and ResolveReference().
|
inline |
Is the variable a reference to a script variable?
References mRefVarNameId.
Referenced by WsfVariable< T >::ValueGreater(), WsfVariable< T >::ValueGreaterOrEqual(), WsfVariable< T >::ValueInClosedRange(), WsfVariable< T >::ValueLess(), and WsfVariable< T >::ValueLessOrEqual().
|
protected |
Return the name of the object for messages.
References WsfComponent::GetComponentName(), WsfPlatform::GetComponentName(), and WsfComponentT< PARENT_TYPE >::GetComponentParent().
Referenced by ResolveReference().
|
protected |
Read a potential reference.
This reads the next item from the input stream, and if it is the start of reference, extract the name of the referenced script variable and any other optional data. If the next item is not a reference, the item is pushed back on the input stream for processing by the caller.
References mRefVarNameId.
Referenced by ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValueOfType(), ReadValueOfType(), and ReadValueOfType().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
Referenced by WsfVariable< T >::ReadValue(), and WsfVariable< WsfStringId >::ReadValue().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
Referenced by WsfVariable< T >::ReadValueOfType().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
References DefaultOptionPresent(), mHasDefaultValue, and ReadReference().
|
protected |
If the variable is a reference, determine the script context and index of the reference.
| aVariableName | The name of the variable as known by the user (for system log/error output) |
| aObjectPtr | The name of the object containing the variable (for system log/error output) |
| aContextPtr | The context from which to start searching to satisfy a reference. |
| aRefValuePtr | [output] The script data object that points to the resolved script variable. This will be 0 if the variable is not a reference or if the reference could not be satisfied. |
| aGlobalContext | The script manager |
References WsfScriptContext::GetContext(), WsfScriptContext::GetPLATFORM(), WsfScriptContext::GetPROCESSOR(), WsfScriptContext::GetSCENARIO(), WsfScenario::GetSystemLog(), HasDefaultValue(), mRefVarNameId, ObjectName(), and WsfSystemLog::WriteLogEntry().
Referenced by Initialize(), Initialize(), Initialize(), Initialize(), Initialize(), and Initialize().
|
protected |
'true' if the '/default' option was provided
Referenced by DefaultOptionPresent(), HasDefaultValue(), WsfVariable< T >::operator+=(), WsfVariable< T >::operator-=(), WsfVariable< T >::operator=(), WsfVariable< T >::operator=(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValue(), ReadValueOfType(), ReadValueOfType(), ReadValueOfType(), and WsfVariableBase().
|
protected |
The name (ID) of the referenced variable. It is less than zero if the variable is not a reference.
Referenced by IsReference(), WsfVariable< T >::operator+=(), WsfVariable< T >::operator-=(), WsfVariable< T >::operator=(), WsfVariable< T >::operator=(), ReadReference(), ResolveReference(), and WsfVariableBase().