group Classes

Description

Class are what objects are made from. There are a number of functions in this group that allows for creation and manipulation of both objects and classes.

group contents
Functions
function ferite_class_call_static_constructor(FeriteScript,FeriteClass) - Call the static constructor on the class
function ferite_class_call_static_destructor(FeriteScript,FeriteClass) - Call the static destructor on the class
function ferite_class_dup(FeriteScript,FeriteClass,FeriteNamespace) - Create a complete duplicate of a class
function ferite_class_finish(FeriteScript,FeriteClass) - Finish the class off and call any relevent functions needed.
function ferite_class_get_function(FeriteScript,FeriteClass,char) - Get a function from a class
function ferite_class_get_function_for_params(FeriteScript,FeriteClass,char,FeriteVariable) - Get a function from an object for a specific set of parameters
function ferite_class_get_var(FeriteScript,FeriteClass,char) - Get a member variable from an class
function ferite_class_has_function(FeriteScript,FeriteClass,char) - Check to see if a class has the named function
function ferite_class_is_subclass(FeriteClass,FeriteClass) - Check to see if one class is the sub-class of another
function ferite_class_variable_class(FeriteScript,FeriteClass,char) - Obtain the class in which a named variable appears within a class tree
function ferite_delete_class(FeriteScript,FeriteClass) - Clean up and free the memory a class takes up
function ferite_delete_class_object(object) - Dispose of an object, the only part of ferite that should be calling this is the garbage collector.
function ferite_find_class(FeriteScript,FeriteNamespace,char) - Find a class within a namespace
function ferite_find_class_id(FeriteScript,FeriteNamespace,char) - Find a class within a namespace, and return it's unique id
function ferite_find_constructor(FeriteScript,FeriteClass) - Get a pointer to the first constructor in a class tree
function ferite_find_static_constructor(FeriteScript,FeriteClass) - Get a pointer to the first static constructor in a class tree
function ferite_generate_class_fqn(FeriteScript,FeriteClass) - Generate a C string containing the full path to a specified class
function ferite_generate_namespace_fqn(FeriteScript,FeriteNamespace) - Generate a C string containing the full path to a specified namespace
function ferite_object_call_super(FeriteScript,FeriteVariable,FeriteVariable) - Call the objects parent class's constructor usefull for writing native classes
function ferite_object_get_function(FeriteScript,FeriteObject,char) - Get a function from an object
function ferite_object_get_function_for_params(FeriteScript,FeriteObject,char,FeriteVariable) - Get a function from an object for a specific set of parameters
function ferite_object_get_var(FeriteScript,FeriteObject,char) - Get a member variable from an object
function ferite_object_has_var(FeriteScript,FeriteObject,char) - Check to see whether an object has a certain variable
function ferite_object_is_sublass(FeriteObject,char) - See if the object is from a subclass of the named class
function ferite_object_set_var(FeriteScript,FeriteObject,char,FeriteVariable) - Set the value of an objects variable
function ferite_object_variable_class(FeriteScript,FeriteObject,char) - Obtain the class in which a named variable appears within an object
function ferite_register_class_function(FeriteScript,FeriteClass,FeriteFunction,int) - Register a function within a class
function ferite_register_class_variable(FeriteScript,FeriteClass,FeriteVariable,int) - Register a variable within a class
function ferite_register_inherited_class(FeriteScript,FeriteNamespace,char,char) - Registers, creates and returns a class object
function ferite_state_to_str(int) - Get a textual description of a object/class members state value

Functions

function ferite_class_call_static_constructor Click to go up to the list
Call the static constructor on the class
Declaration:
    void ferite_class_call_static_constructor( FeriteScript *script, FeriteClass *klass )
Description:
This function will traverse the heirachy within the class system to allow for parents to be called.
Parameters:
    Parameter #1: FeriteScript *script - The script in which the class resides
    Parameter #2: FeriteClass *klass - The class

function ferite_class_call_static_destructor Click to go up to the list
Call the static destructor on the class
Declaration:
    void ferite_class_call_static_destructor( FeriteScript *script, FeriteClass *klass )
Description:
This function will traverse the heirachy within the class system to allow for parents to be called.
Parameters:
    Parameter #1: FeriteScript *script - The script in which the class resides
    Parameter #2: FeriteClass *klass - The class

function ferite_class_dup Click to go up to the list
Create a complete duplicate of a class
Declaration:
    FeriteClass *ferite_class_dup( FeriteScript *script, FeriteClass *klass, FeriteNamespace *container )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *klass - The class to duplicate
    Parameter #3: FeriteNamespace *container - A pointer to the namespace that will hold the class
Returns:
    A pointer to a new FeriteClass structure

function ferite_class_finish Click to go up to the list
Finish the class off and call any relevent functions needed.
Declaration:
    void ferite_class_finish( FeriteScript *script, FeriteClass *klass )
Parameters:
    Parameter #1: FeriteScript *script - The script the class sits in
    Parameter #2: FeriteClass *klass - The class to finish off

function ferite_class_get_function Click to go up to the list
Get a function from a class
Declaration:
    FeriteFunction *ferite_class_get_function( FeriteScript *script, FeriteClass *cls, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *cls - The class to get the function from
    Parameter #3: char *name - The name of the function
Returns:
    The function on success, NULL otherwise

function ferite_class_get_function_for_params Click to go up to the list
Get a function from an object for a specific set of parameters
Declaration:
    FeriteFunction *ferite_class_get_function_for_params( FeriteScript *script, FeriteClass *klass, char *name, FeriteVariable **params )
Description:
This function will traverse the inheritance tree the class is from and look for a function that matches the given name and parameters.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *klass - The class to get the function from
    Parameter #3: char *name - The name of the function
    Parameter #4: FeriteVariable **params - The parameters that wish to be passed to the function
Returns:
    The function on success, NULL otherwise

function ferite_class_get_var Click to go up to the list
Get a member variable from an class
Declaration:
    FeriteVariable *ferite_class_get_var( FeriteScript *script, FeriteClass *klass, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *klass - The class to get the variable from
    Parameter #3: char *name - The name of the member to get
Returns:
    The variable on success, NULL otherwise

function ferite_class_has_function Click to go up to the list
Check to see if a class has the named function
Declaration:
    int ferite_class_has_function(FeriteScript *script, FeriteClass *cls, char *name)
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *cls - The class to check in
    Parameter #3: char *name - The name of the function
Returns:
    FE_TRUE on success, FE_FALSE otherwise

function ferite_class_is_subclass Click to go up to the list
Check to see if one class is the sub-class of another
Declaration:
    int ferite_class_is_subclass( FeriteClass *klass, FeriteClass *subklass )
Parameters:
    Parameter #1: FeriteClass *klass - The class to check against
    Parameter #2: FeriteClass *subklass - The class to check with
Returns:
    FE_TRUE if it is a sub-class, FE_FALSE otherwise

function ferite_class_variable_class Click to go up to the list
Obtain the class in which a named variable appears within a class tree
Declaration:
    FeriteClass *ferite_class_variable_class( FeriteScript *script, FeriteClass *klass, char *name )
Description:
Due to the way that variables are stored within the class hierachy, it is useful to find out to which class a variable exists.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *klass - The class to look in
    Parameter #3: char *name - The name of the member to get
Returns:
    The class if the varible exists and the class can be found, NULL otherwise

function ferite_delete_class Click to go up to the list
Clean up and free the memory a class takes up
Declaration:
    void ferite_delete_class( FeriteScript *script, FeriteClass *klass )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteClass *klass - The class to be deleted

function ferite_delete_class_object Click to go up to the list
Dispose of an object, the only part of ferite that should be calling this is the garbage collector.
Declaration:
    void ferite_delete_class_object( FeriteObject *object )
Parameters:
    Parameter #1: object The - object to be nuked.

function ferite_find_class Click to go up to the list
Find a class within a namespace
Declaration:
    FeriteClass *ferite_find_class( FeriteScript *script, FeriteNamespace *ns, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteNamespace *ns - The top level namespace to look in
    Parameter #3: char *name - The name of the class to find.
Returns:
    The class on success or NULL otherwise

function ferite_find_class_id Click to go up to the list
Find a class within a namespace, and return it's unique id
Declaration:
    long ferite_find_class_id( FeriteScript *script, FeriteNamespace *ns, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteNamespace *ns - The top level namespace to look in
    Parameter #3: char *name - The name of the class to find.
Returns:
    The id or 0 otherwise

function ferite_find_constructor Click to go up to the list
Get a pointer to the first constructor in a class tree
Declaration:
    FeriteFunction *ferite_find_constructor( FeriteScript *script, FeriteClass *klass )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *klass - The class to start with
Returns:
    A pointer to the function, or NULL otherwise

function ferite_find_static_constructor Click to go up to the list
Get a pointer to the first static constructor in a class tree
Declaration:
    FeriteFunction *ferite_find_static_constructor( FeriteScript *script, FeriteClass *klass )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteClass *klass - The class to start with
Returns:
    A pointer to the function, or NULL otherwise

function ferite_generate_class_fqn Click to go up to the list
Generate a C string containing the full path to a specified class
Warning!
It is up to the calling function to free up the memory returned
Declaration:
    char *ferite_generate_class_fqn( FeriteScript *script, FeriteClass *klass )
Parameters:
    Parameter #1: FeriteScript *script - The script context
    Parameter #2: FeriteClass *klass - The class whose path is required.
Returns:
    A c string containing the path

function ferite_generate_namespace_fqn Click to go up to the list
Generate a C string containing the full path to a specified namespace
Warning!
It is up to the calling function to free up the memory returned
Declaration:
    char *ferite_generate_namespace_fqn( FeriteScript *script, FeriteNamespace *ns )
Parameters:
    Parameter #1: FeriteScript *script - The script context
    Parameter #2: FeriteNamespace *ns - The namespace whose path is required.
Returns:
    A c string containing the path

function ferite_object_call_super Click to go up to the list
Call the objects parent class's constructor usefull for writing native classes
Declaration:
    void ferite_object_call_super( FeriteScript *script, FeriteObject *object, FeriteVariable **params )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteVariable The - container on which to call the super constructor
    Parameter #3: FeriteVariable **params - The parameters to pass to the function call

function ferite_object_get_function Click to go up to the list
Get a function from an object
Declaration:
    FeriteFunction *ferite_object_get_function( FeriteScript *script, FeriteObject *object, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteObject *object - The object to get the function from
    Parameter #3: char *name - The name of the function
Returns:
    The function on success, NULL otherwise

function ferite_object_get_function_for_params Click to go up to the list
Get a function from an object for a specific set of parameters
Declaration:
    FeriteFunction *ferite_object_get_function_for_params( FeriteScript *script, FeriteObject *object, char *name, FeriteVariable **params )
Description:
This function will traverse the inheritance tree the object is from and look for a function that matches the given name and parameters.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteObject *object - The object to get the function from
    Parameter #3: char *name - The name of the function
    Parameter #4: FeriteVariable **params - The parameters that wish to be passed to the function
Returns:
    The function on success, NULL otherwise

function ferite_object_get_var Click to go up to the list
Get a member variable from an object
Declaration:
    FeriteVariable *ferite_object_get_var( FeriteScript *script, FeriteObject *object, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteObject *object - The object to get the variable from
    Parameter #3: char *name - The name of the member to get
Returns:
    The variable on success, NULL otherwise

function ferite_object_has_var Click to go up to the list
Check to see whether an object has a certain variable
Declaration:
    int ferite_object_has_var(FeriteScript* script, FeriteObject* obj, char *id)
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteObject *obj - The object to check
    Parameter #3: char *id - The name of the variable
Returns:
    If the variable exists FE_TRUE is returned, otherwise FE_FALSE

function ferite_object_is_sublass Click to go up to the list
See if the object is from a subclass of the named class
Declaration:
    int ferite_object_is_sublass( FeriteObject *obj, char *name )
Parameters:
    Parameter #1: FeriteObject *obj - The object to check
    Parameter #2: char *name - The name of the class
Returns:
    FE_TRUE if the object is, FE_FALSE otherwise

function ferite_object_set_var Click to go up to the list
Set the value of an objects variable
Declaration:
    void ferite_object_set_var( FeriteScript* script, FeriteObject* obj, char *id, FeriteVariable *d_var )
Description:
If the variable exists, the value is updated, otherwise a new variable is added to the objects variables
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteObject *obj - The object whose member is to be set
    Parameter #3: char *name - The name of the variable
    Parameter #4: FeriteVariable *d_var - The data used

function ferite_object_variable_class Click to go up to the list
Obtain the class in which a named variable appears within an object
Declaration:
    FeriteClass *ferite_object_variable_class( FeriteScript *script, FeriteObject *object, char *name )
Description:
Due to the way that variables are stored within the class hierachy, it is useful to find out to which class a variable exists.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteObject *object - The object to look in
    Parameter #3: char *name - The name of the member to get
Returns:
    The class if the varible exists and the class can be found, NULL otherwise

function ferite_register_class_function Click to go up to the list
Register a function within a class
Declaration:
    int ferite_register_class_function( FeriteScript *script, FeriteClass *klass, FeriteFunction *f )
Description:
It must be noted that the function being passed must not have the super, and self variables within their signitue, this function will handle that automatically
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteClass *klass - The class to place the function in
    Parameter #3: FeriteFunction *f - The function structure
    Parameter #4: int is_static - Boolean, 0 = not static, 1 = static. Allows the specifcation of whether or not the function has static access within the class
Returns:
    1 if function was registered correctly, 0 otherwise

function ferite_register_class_variable Click to go up to the list
Register a variable within a class
Declaration:
    int ferite_register_class_variable( FeriteScript *script, FeriteClass *klass, FeriteVariable *variable, int is_static )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteClass *klass - The class to attach the variable to
    Parameter #3: FeriteVariable *variable - The variable to register
    Parameter #4: int is_static - Boolean, 0 = not static, 1 = static. Allows the specifcation of whether or not the variable has static access within the class
Returns:
    1 on success, 0 otherwise

function ferite_register_inherited_class Click to go up to the list
Registers, creates and returns a class object
Declaration:
    FeriteClass *ferite_register_inherited_class( FeriteScript *script, FeriteNamespace *ns, char *name, char *parent )
Description:
This is the only way to create a class natively.
Parameters:
    Parameter #1: FeriteScript *script - The current script being run
    Parameter #2: FeriteNamespace *ns - The namespace in which the class should be registered
    Parameter #3: char *name - The name of the class eg. Socket
    Parameter #4: char *parent - The name of the parent class, this is the class that will be inherited from, if NULL the class will inherit from the base class 'Obj'.
Returns:
    The newly created class

function ferite_state_to_str Click to go up to the list
Get a textual description of a object/class members state value
Declaration:
    char *ferite_state_to_str( int state )
Parameters:
    Parameter #1: int state - The state to give back
Returns:
    A point to a constant string

Automatically generated at 12:07PM, Wednesday 25 May 2005 by feritedoc.