TorqueScript  0.2
Public Member Functions | Protected Attributes | List of all members
TorqueScript::ConsoleObject Class Referenceabstract

Base class for object instances recognized by the interpreter. These object instances may contain member fields addressable the interpreter as well as tagged fields which are arbitrarily mapped values. More...

#include <consoleobject.hpp>

Inheritance diagram for TorqueScript::ConsoleObject:
Inheritance graph
[legend]
Collaboration diagram for TorqueScript::ConsoleObject:
Collaboration graph
[legend]

Public Member Functions

 ConsoleObject (Interpreter *interpreter)
 
StoredValuegetTaggedField (const std::string &name)
 Retrieves a tagged field by name from the object. More...
 
void setTaggedField (const std::string &name, StoredValue value)
 Sets a tagged field by name on the object. More...
 
virtual std::string getClassName ()=0
 Retrieves the class name of this ConsoleObject instance. More...
 
virtual bool addChild (std::shared_ptr< ConsoleObject > child)
 

Protected Attributes

InterpretermInterpreter
 
std::unordered_map< std::string, StoredValuemTaggedFields
 A mapping of tagged field names to their stored values.
 

Detailed Description

Base class for object instances recognized by the interpreter. These object instances may contain member fields addressable the interpreter as well as tagged fields which are arbitrarily mapped values.

Member Function Documentation

◆ getClassName()

virtual std::string TorqueScript::ConsoleObject::getClassName ( )
pure virtual

Retrieves the class name of this ConsoleObject instance.

Returns
A string representing the class name of this ConsoleObject.

◆ getTaggedField()

StoredValue* TorqueScript::ConsoleObject::getTaggedField ( const std::string &  name)

Retrieves a tagged field by name from the object.

Parameters
Thetagged field name to retrieve, which is case insensitive.
Returns
A StoredValue pointer of the value currently in that tagged field slot.

◆ setTaggedField()

void TorqueScript::ConsoleObject::setTaggedField ( const std::string &  name,
StoredValue  value 
)

Sets a tagged field by name on the object.

Parameters
nameThe tagged field name to set, which is case insensitive.
valueThe value to set.

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