ScriptRobot
 All Classes Functions Typedefs Enumerations Enumerator
GlobalProperty Class Reference

GlobalProperty class. More...

#include <GlobalProperty.h>

Public Member Functions

  GlobalProperty ()
  GlobalProperty constructor. More...
 
  ~GlobalProperty ()
  GlobalProperty destructor. More...
 
void  setup (std::string definition, std::string type, std::string name, void *ptr)
  Sets the members of a GlobalProperty. More...
 
bool  registerProperty (asIScriptEngine *engine)
  Registers this property with the angelscript engine. More...
 
void  release ()
  Releases the global property. More...
 
void *  getPtr ()
  Returns the pointer to the property. More...
 
std::string  getDefinition ()
  Returns the property definition. More...
 
std::string  getType ()
  Returns the property type. More...
 
std::string  getName ()
  Returns the property name. More...
 

Detailed Description

GlobalProperty class.

Creates an angelscript global property, manages and releases it when the instance of this class is destroyed. The pointer to the property must be kept alive for the duration of the instance of this class containing it. The pointer should then be freed by the application writer.

Constructor & Destructor Documentation

GlobalProperty::GlobalProperty ( )

GlobalProperty constructor.

Creates an empty instance of a GlobalProperty class. with ptr set to NULL.

GlobalProperty::~GlobalProperty ( )

GlobalProperty destructor.

calls release().

See Also
release()

Member Function Documentation

std::string GlobalProperty::getDefinition ( )

Returns the property definition.

Returns
the property definition.
std::string GlobalProperty::getName ( )

Returns the property name.

Returns
the property name.
void * GlobalProperty::getPtr ( )

Returns the pointer to the property.

Returns
the pointer to the property.
std::string GlobalProperty::getType ( )

Returns the property type.

Returns
the property type.
bool GlobalProperty::registerProperty ( asIScriptEngine *  engine )

Registers this property with the angelscript engine.

This will only work if setup() was called before.

Parameters
engine a valid instance of an anglescript engine.
Returns
true on success.
void GlobalProperty::release ( )

Releases the global property.

Removes the angelscript dynamic config group containing the property.

void GlobalProperty::setup ( std::string  definition,
std::string  type,
std::string  name,
void *  ptr 
)

Sets the members of a GlobalProperty.

If the members have been previously set this wont work.

Parameters
definition the line in a config where this property was pulled from.
type the angelscript string representation of the property type.
name the name of the property as to be accessed in angelscript code.
a pointer to the corresponding property.

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