Tags
SGS_OBJECT
SGS_OBJECT_LITE
SGS_OBJECT_INHERIT
Marks the objects/structures for parsing.
SGS_OBJECT_LITE does not add helper variables (sgs_VarObj* m_sgsObject; sgs_Context* C) to the class
SGS_OBJECT_INHERIT specifies class or classes to inherit definitions from
SGS_NO_EXPORT
SGS_NO_DESTRUCT
Object binding modifiers.
- SGS_NO_EXPORT prevents C++/BC from generating the binding code for this class (but it may still be used for derived classes)
- SGS_NO_DESTRUCT prevents C++/BC from generating destructor code for this class (helps in the definition of weak objects)
SGS_METHOD
Marks the methods that should be made available to the scripting engine.
Syntax: SGS_METHOD <type> <name>(<arguments>)
Alt. syntax (bind without declaration): SGS_METHOD SGS_ALIAS( <type> <name>(<arguments>) );
- SGS_MULTRET can be used as <type> to allow the return value specify the number of return values pushed (like a usual SGScript C function)
- SGS_CTX /
sgs_Context*
arguments are not counted in the SGScript argument list
SGS_METHOD_NAMED
Marks the renamed methods that should be made available to the scripting engine.
Syntax: SGS_METHOD_NAMED( <sgsname> ) <type> <realname>(<arguments>)
See SGS_METHOD for more info.
SGS_STATICMETHOD
Marks the static methods that should be made available to the scripting engine.
Syntax: SGS_STATICMETHOD <type> <name>(<arguments>)
Alt. syntax (bind without declaration): SGS_STATICMETHOD SGS_ALIAS( <type> <name>(<arguments>) );
- SGS_MULTRET can be used as <type> to allow the return value specify the number of return values pushed (like a usual SGScript C function)
- SGS_CTX /
sgs_Context*
arguments can be used to get the context (theC
member variable is unavailable) and are not counted in the SGScript argument list
SGS_STATICMETHOD_NAMED
Marks the renamed methods that should be made available to the scripting engine.
Syntax: SGS_STATICMETHOD_NAMED( <sgsname> ) <type> <realname>(<arguments>)
See SGS_STATICMETHOD for more info.
SGS_PROPERTY
Marks the properties that should be made available to the scripting engine. Currently supports only one property at a time.
Syntax: SGS_PROPERTY [READ|WRITE] <type> <name>;
Alt. syntax (bind without declaration): SGS_PROPERTY [READ|WRITE] SGS_ALIAS( <type> <name> );
Modifiers:
- READ: make the property read-only
- WRITE: make the property write-only
SGS_PROPERTY_FUNC
Marks the properties that should be made available to the scripting engine. Has additional options for reading, writing and callbacks.
Syntax: SGS_PROPERTY_FUNC( <tag-args> ) <type> <name>;
Alt. syntax (bind without declaration): SGS_PROPERTY_FUNC( <tag-args> ) SGS_ALIAS( <type> <name> );
Tag arguments: a space separated list of none or more of the following constructs
- READ: allow to read from the property
- WRITE: allow to write to the property
- READ <method>: allow to read from the property, using the specified method
- WRITE <method>: allow to write to the property, using the specified method
- READ_CALLBACK <method>: call the specified method after reading from the variable
- WRITE_CALLBACK <method>: call the specified method after writing to the variable
- VARNAME: specify a different name for the real variable (more useful with alt. syntax)
- VALIDATE: specify a boolean-compatible (zero=false/nonzero=true, like bool/pointers) data source to use for checking availability
- SOURCE: specify the data source to use for this property
SGS_IFUNC
Marks the method as a native object interface function that would override any generated one.
Syntax: SGS_IFUNC( <ifunc-type> ) <type> <name>( sgs_Context*, sgs_VarObj*, int );
"ifunc-type" must be one of object interface function defines (destruct, getindex, expr etc.).
SGS_GCREF
Marks objects to be marked for garbage collection.
Syntax: SGS_GCREF( <var1> <var2> ... )
SGS_DUMP
Marks member variables as available for dumping.
Syntax: SGS_DUMP( <var1> <var2> ... )
All readable properties are dumped by default, this is used to specify variables that are not already specified as readable properties.
To prevent certain properties from being dumped, see SGS_NODUMP
SGS_NODUMP
Marks readable properties as unavailable for dumping.
Syntax: SGS_NODUMP( <var1> <var2> ... )
All readable properties are dumped by default, this is used to disable that for certain variables.
SGS_BACKING_STORE
Marks a variable to be used as backing store (read from and write to it if a property/index-related action doesn't match any of this object's properties).
Syntax SGS_BACKING_STORE( (READ|WRITE) <var> )
* var
should be sgsVariable.
* It is not automatically initialized - to enable the system, it should be initialized to an object with free write capabilities (like dict
/map
)