Table Of Contents

Previous topic

SObject Functions

Next topic

SObject Primitives

SObjectClass Functions

Provides class type functions.

Summary

s_class_add Add a class to the object system.
s_class_init Initialize a class with the object system.
s_class_reg Register a class with the object system.
s_class_free Free a class from the object system.
s_class_name Get the name of the given class’s object.
s_class_inheritance Get the complete inheritance of the given class’s object.
s_class_is_reg Query if the given object’s class is registered.
s_class_find Get an object’s class by name.

Functions

void s_class_add(const SObjectClass *cls, s_erc *error)

Add a class to the object system.

The class gets added to the table of classes available for object instantiation.

Parameters:
  • cls

    Class object to add.

  • error

    Error Code.

Note:

Class names must be unique.

void s_class_init(const SObjectClass *cls, s_erc *error)

Initialize a class with the object system.

The object system will get the class’s inheritance hierarchy ready for instantiating class objects.

Parameters:
  • cls

    Class object to initialize.

  • error

    Error Code.

void s_class_reg(const SObjectClass *cls, s_erc *error)

Register a class with the object system.

This performs the function of s_class_add and s_class_init and is the preferred method for adding new classes through plug-ins.

Parameters:
  • cls

    Class object to register.

  • error

    Error Code.

void s_class_free(const SObjectClass *cls, s_erc *error)

Free a class from the object system.

After this function is called on a class no objects of that class type can be instantiated anymore. Plug-ins must call this function on exit for any classes registered by the plug-in.

Parameters:
  • cls

    Class object to free.

  • error

    Error Code.

const char *s_class_name(const SObjectClass *cls, s_erc *error)

Get the name of the given class’s object.

The inheritance hierarchy is removed from the class’s registered name and only the actual class object name is returned.

Parameters:
  • cls

    Class object to get name from.

  • error

    Error Code.

Return:

The class’s object name.

const char *s_class_inheritance(const SObjectClass *cls, s_erc *error)

Get the complete inheritance of the given class’s object.

The inheritance will exclude the SObject.

Parameters:
  • cls

    Class object to get inheritance from.

  • error

    Error Code.

Return:

A colon (”:”) separated string of the given class’s object inheritance hierarchy, excluding SObject.

s_bool s_class_is_reg(const char *name, s_erc *error)

Query if the given object’s class is registered.

Parameters:
  • name

    The object name to query.

  • error

    Error code.

Return:

TRUE if the object’s class is registered else FALSE.

const SObjectClass *s_class_find(const char *name, s_erc *error)

Get an object’s class by name.

Parameters:
  • name

    The object type name of the desired object’s class.

  • error

    Error Code.

Return:

The class object.