|
LRAUV
revA
|
Implements ScriptNode for the LuaAPI. More...
#include <LuaNode.h>


Public Member Functions | |
| virtual | ~LuaNode () |
| Destructor. More... | |
| virtual bool | hasChildNodes () const |
| Returns true if the node contains child nodes. More... | |
| virtual LuaNode * | getNamedNode (const Str &nodeName) |
| Returns the child node, by name, or NULL if none. More... | |
| virtual LuaNode * | newChildNode (const Str &nodeName) |
| Returns a new child node than can contain other nodes. More... | |
| virtual LuaNode * | newChildFunction (const Str &functionName, const Str &functionBody, Logger &logger) |
| Returns a new child node that is a function. More... | |
| virtual int | getNodeCount (const Str &nodeName) const |
| Returns the number of indexed (array, or list-like) nodes Returns 0 is this is not a table. More... | |
| virtual LuaNode * | getIndexedNode (unsigned int index) |
| Returns the indexed (array, or list-like) node at the zero-based index, or NULL if none. More... | |
| virtual LuaNode * | getParentNode () const |
| Returns the parent node, or NULL if this is the root. More... | |
| virtual int | getIndex () const |
| Returns the index of the node, -1 if named. More... | |
| virtual const Str & | getName () const |
| Returns the name of the node, undefined if indexed. More... | |
| virtual bool | readBool (bool &readTo) const |
| Sets readTo to the value of the node, as a boolean Returns true if read success. More... | |
| virtual bool | readDouble (double &readTo) const |
| Sets readTo to the value of the node, as a double Returns true if read success. More... | |
| virtual bool | readString (Str &readTo) const |
| Sets readTo to the value of the node, unsigned char string Returns true if read success. More... | |
| virtual DataValue * | asNewDataValue () |
| If the node contains a dataValue, materialize such a dataValue Uses the Unit + value paradigm. More... | |
| virtual bool | execute (FlexArray< DataReader * > &inputs, FlexArray< SettingReader * > &settings, FlexArray< DataWriter * > &outputs, FlexArray< const Unit * > &outUnits, Logger &logger) |
| Attempt to execute the function contained in this node. More... | |
| virtual bool | execute (FlexArray< DataReader * > &inputs, FlexArray< SettingReader * > &settings, bool &boolOutput, Logger &logger) |
| Attempt to execute the function contained in this node, returning only a single boolean value. More... | |
| virtual bool | execute (Logger &logger) |
| Attempt to execute the function contained in this node, with no inputs and no return value. More... | |
| virtual Str | toString () const |
| Returns a string representation of this node, with its ancestors, separated by "." characters. More... | |
Public Member Functions inherited from ScriptNode | |
| virtual | ~ScriptNode () |
| Destructor. More... | |
Private Member Functions | |
| LuaNode (const LuaNode &old) | |
| LuaNode () | |
| Private root node constructor, available to LuaAPI too. More... | |
| LuaNode (LuaNode *parentNode, int index) | |
| Private "index" constructor, available to LuaAPI too. More... | |
| LuaNode (LuaNode *parentNode, const Str &name) | |
| Private "name" constructor, available to LuaAPI too. More... | |
| bool | open () const |
| Open this node. More... | |
| void | close () const |
| Close this node. More... | |
| bool | isRoot () const |
| True if this is the root element. More... | |
Private Attributes | |
| LuaNode * | parentNode_ |
| Parent node. More... | |
| int | index_ |
| The index of this node. More... | |
| Str | name_ |
| The name of this node. More... | |
| FastMap< const Str, LuaNode * > * | childMap_ |
| Map of named elements. More... | |
| FlexArray< LuaNode * > * | childList_ |
| Array of numbered elements. More... | |
Friends | |
| class | LuaAPI |
Additional Inherited Members | |
Protected Member Functions inherited from ScriptNode | |
| ScriptNode () | |
| Protected constructor for abstract base class. More... | |
Implements ScriptNode for the LuaAPI.
|
virtual |
Destructor.
References childList_, childMap_, FastMap< S, T >::popIndexed(), and FastMap< S, T >::size().
|
private |
|
private |
Private root node constructor, available to LuaAPI too.
Private root Node constructor.
Referenced by getIndexedNode(), and getNamedNode().
|
private |
Private "index" constructor, available to LuaAPI too.
Private "name" constructor, available to LuaAPI too.
|
virtual |
If the node contains a dataValue, materialize such a dataValue Uses the Unit + value paradigm.
Implements ScriptNode.
References Str::cStr(), Str::EMPTY_STR, UnitRegistry::FindUnit(), getIndexedNode(), getNamedNode(), getNodeCount(), ScriptNode::readDouble(), readDouble(), readString(), and toString().
|
private |
Close this node.
References close(), LuaAPI::CloseTableItem(), and parentNode_.
Referenced by close(), execute(), getIndexedNode(), getNamedNode(), getNodeCount(), hasChildNodes(), newChildFunction(), newChildNode(), readBool(), readDouble(), and readString().
|
virtual |
Attempt to execute the function contained in this node.
Implements ScriptNode.
References close(), LuaAPI::Exec(), open(), and LuaAPI::PushNil().
|
virtual |
Attempt to execute the function contained in this node, returning only a single boolean value.
Implements ScriptNode.
References close(), LuaAPI::Exec(), open(), and LuaAPI::PushNil().
|
virtual |
Attempt to execute the function contained in this node, with no inputs and no return value.
Implements ScriptNode.
References close(), LuaAPI::Exec(), open(), and LuaAPI::PushNil().
|
inlinevirtual |
|
virtual |
Returns the indexed (array, or list-like) node at the zero-based index, or NULL if none.
Implements ScriptNode.
References childList_, close(), LuaAPI::CloseTableItem(), FlexArray< T >::get(), isRoot(), LuaNode(), open(), LuaAPI::OpenTableItemByIndex(), and FlexArray< T >::set().
Referenced by asNewDataValue().
|
inlinevirtual |
Returns the child node, by name, or NULL if none.
Implements ScriptNode.
References childMap_, close(), LuaAPI::CloseTableItem(), Str::cStr(), FastMap< S, T >::get(), isRoot(), LuaNode(), open(), LuaAPI::OpenTableItemByName(), and FastMap< S, T >::put().
Referenced by asNewDataValue(), LuaAPI::makeScriptFunction(), newChildFunction(), and newChildNode().
|
virtual |
Returns the number of indexed (array, or list-like) nodes Returns 0 is this is not a table.
Implements ScriptNode.
References close(), LuaAPI::GetTableSize(), isRoot(), LuaAPI::IsTable(), and open().
Referenced by asNewDataValue().
|
virtual |
Returns the parent node, or NULL if this is the root.
Implements ScriptNode.
References parentNode_.
|
virtual |
Returns true if the node contains child nodes.
Implements ScriptNode.
References close(), isRoot(), LuaAPI::IsTable(), and open().
|
inlineprivate |
True if this is the root element.
References parentNode_.
Referenced by getIndexedNode(), getNamedNode(), getNodeCount(), hasChildNodes(), newChildFunction(), newChildNode(), open(), readBool(), readDouble(), and readString().
|
virtual |
Returns a new child node that is a function.
Implements ScriptNode.
References close(), Syslog::CRITICAL, Str::cStr(), getNamedNode(), isRoot(), LuaAPI::NewFunction(), open(), and Logger::syslog().
Referenced by LuaAPI::makeScriptFunction().
Returns a new child node than can contain other nodes.
Implements ScriptNode.
References close(), Str::cStr(), getNamedNode(), isRoot(), LuaAPI::NewTable(), and open().
Referenced by LuaAPI::makeScriptFunction().
|
private |
Open this node.
References Str::cStr(), index_, isRoot(), name_, open(), LuaAPI::OpenTableItemByIndex(), LuaAPI::OpenTableItemByName(), and parentNode_.
Referenced by execute(), getIndexedNode(), getNamedNode(), getNodeCount(), hasChildNodes(), newChildFunction(), newChildNode(), open(), readBool(), readDouble(), and readString().
|
virtual |
Sets readTo to the value of the node, as a boolean Returns true if read success.
Implements ScriptNode.
References close(), LuaAPI::GetBool(), isRoot(), and open().
|
virtual |
Sets readTo to the value of the node, as a double Returns true if read success.
Implements ScriptNode.
References close(), LuaAPI::GetNumber(), isRoot(), and open().
Referenced by asNewDataValue().
|
virtual |
Sets readTo to the value of the node, unsigned char string Returns true if read success.
Implements ScriptNode.
References close(), LuaAPI::GetString(), isRoot(), and open().
Referenced by asNewDataValue().
|
virtual |
Returns a string representation of this node, with its ancestors, separated by "." characters.
Implements ScriptNode.
References index_, name_, parentNode_, and toString().
Referenced by asNewDataValue(), and toString().
|
friend |
Array of numbered elements.
Referenced by getIndexedNode(), and ~LuaNode().
Map of named elements.
Referenced by getNamedNode(), and ~LuaNode().
|
private |
The index of this node.
Referenced by getIndex(), open(), and toString().
|
private |
The name of this node.
Referenced by getName(), open(), and toString().
|
private |
Parent node.
Referenced by close(), getParentNode(), isRoot(), open(), and toString().