Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::ScriptObject Class Referenceabstract

Info structure for objects used in scripts. More...

#include <ScriptObject.h>

Inheritance diagram for sf::ScriptObject:

Classes

struct  IdInfo
 Used to create static lookup lists. More...
 
struct  Parameters
 Type to pass to registered classes. More...
 

Public Types

enum  EIdentifier {
  idUnknown = 0 , idConstant , idVariable , idFunction ,
  idTypedef , idKeyword
}
 Keyword identifiers. More...
 
typedef std::string::size_type pos_type
 Source position type.
 
typedef ssize_t ip_type
 Instruction pointer type.
 

Public Member Functions

 ScriptObject (const char *type_name, ScriptObject *parent=nullptr)
 
virtual ~ScriptObject ()=default
 Virtual destructor which can be overloaded to clean up objects.
 
virtual const IdInfogetInfo (const std::string &name) const =0
 Must be overloaded for member namespace.
 
virtual std::string getStatusText ()
 Gets the status text of this object for debugging purposes.
 
virtual bool getSetValue (const IdInfo *info, Value *value, Value::vector_type *params, bool flag_set)=0
 Gets or sets the a passed data member. Must be overloaded in derived class.
 
virtual void destroyObject (bool &should_delete)=0
 Asks if the object should be deleted after having made this call.
 
int getRefCount () const
 Gets the reference count.
 
 operator Value () const
 Cast operator to be able to return this instance as a Value.
 
std::string getTypeName () const
 Returns the type name Set at the constructor.
 
ScriptObjectgetParent ()
 Gets the script object owner.
 
const ScriptObjectgetParent () const
 Gets the script object owner.
 
ScriptObjectcastToObject (const Value &value)
 Casts a sf::Value::vitCustom typed sf::Value to a ScriptObject typed pointer.
 

Static Public Member Functions

static const IdInfogetInfoUnknown ()
 Returns the static Info structure for unknowns.
 
static sf::TClassRegistration< ScriptObject, ScriptObject::ParametersInterface ()
 

Protected Member Functions

void makeParent (ScriptObject *so)
 Makes this object the owner of the other object.
 
void setParent (ScriptObject *parent)
 Sets the owner to the pass script object.
 

Friends

class ScriptInterpreter
 
class sf::TClassRegistration< ScriptObject, ScriptObject::Parameters >
 

Detailed Description

Info structure for objects used in scripts.

Member Typedef Documentation

◆ ip_type

typedef ssize_t sf::ScriptObject::ip_type

Instruction pointer type.

◆ pos_type

typedef std::string::size_type sf::ScriptObject::pos_type

Source position type.

Member Enumeration Documentation

◆ EIdentifier

Keyword identifiers.

Enumerator
idUnknown 

Unknown to script

idConstant 

Is a constant like PI.

idVariable 

Is a variable which can be assigned.

idFunction 

Is a callable function.

idTypedef 

Is a type definition like 'int', 'float', string, 'undef' and 'object'.

idKeyword 

Keyword like 'if' and not used at the moment.

Constructor & Destructor Documentation

◆ ScriptObject()

sf::ScriptObject::ScriptObject ( const char *  type_name,
ScriptObject parent = nullptr 
)
explicit

Constructor.

◆ ~ScriptObject()

virtual sf::ScriptObject::~ScriptObject ( )
virtualdefault

Virtual destructor which can be overloaded to clean up objects.

Member Function Documentation

◆ castToObject()

ScriptObject * sf::ScriptObject::castToObject ( const Value value)

Casts a sf::Value::vitCustom typed sf::Value to a ScriptObject typed pointer.

◆ destroyObject()

virtual void sf::ScriptObject::destroyObject ( bool &  should_delete)
pure virtual

Asks if the object should be deleted after having made this call.

Implemented in sf::FileFindObject, sf::IniProfileObject, sf::StringsObject, sf::ResultDataScriptObject, sf::VariableScriptObject, and sf::ScriptGlobalObject.

◆ getInfo()

virtual const IdInfo * sf::ScriptObject::getInfo ( const std::string &  name) const
pure virtual

◆ getInfoUnknown()

static const IdInfo * sf::ScriptObject::getInfoUnknown ( )
static

Returns the static Info structure for unknowns.

◆ getParent() [1/2]

ScriptObject * sf::ScriptObject::getParent ( )
inline

Gets the script object owner.

◆ getParent() [2/2]

const ScriptObject * sf::ScriptObject::getParent ( ) const
inline

Gets the script object owner.

◆ getRefCount()

int sf::ScriptObject::getRefCount ( ) const
inline

Gets the reference count.

◆ getSetValue()

virtual bool sf::ScriptObject::getSetValue ( const IdInfo info,
Value value,
Value::vector_type params,
bool  flag_set 
)
pure virtual

◆ getStatusText()

virtual std::string sf::ScriptObject::getStatusText ( )
virtual

Gets the status text of this object for debugging purposes.

Reimplemented in sf::ResultDataScriptObject, and sf::VariableScriptObject.

◆ getTypeName()

std::string sf::ScriptObject::getTypeName ( ) const

Returns the type name Set at the constructor.

◆ Interface()

static sf::TClassRegistration< ScriptObject, ScriptObject::Parameters > sf::ScriptObject::Interface ( )
static

◆ makeParent()

void sf::ScriptObject::makeParent ( ScriptObject so)
protected

Makes this object the owner of the other object.

◆ operator Value()

sf::ScriptObject::operator Value ( ) const
explicit

Cast operator to be able to return this instance as a Value.

◆ setParent()

void sf::ScriptObject::setParent ( ScriptObject parent)
protected

Sets the owner to the pass script object.

Friends And Related Symbol Documentation

◆ ScriptInterpreter

friend class ScriptInterpreter
friend

◆ sf::TClassRegistration< ScriptObject, ScriptObject::Parameters >


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