## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# csutil/scf.h File Reference

Crystal Space Shared Class Facility (SCF). More...

`#include "csextern.h"`
`#include "csutil/array.h"`
`#include "csutil/ref.h"`
`#include "csutil/scf_interface.h"`
`#include "csutil/reftrackeraccess.h"`

Go to the source code of this file.

## Classes

struct | iFactory
| iFactory is an interface that is used to create instances of shared classes. More...
void | scfRegisterStaticClass (scfFactoryFunc, const char *iClassID, const char *Description, const char *Dependencies=0)
| Register a static class.
void | scfRegisterStaticClasses (char const *xml)
| Register a static class.
void | scfRegisterStaticFactoryFunc (scfFactoryFunc, const char *FactClass)
| Register a static class.

## Defines

#define | CS_TYPENAME(x) 0
#define | SCF_CONSTRUCT_EMBEDDED_IBASE(Interface)
| The SCF_CONSTRUCT_EMBEDDED_IBASE macro should be invoked inside the constructor of a class that has an embedded interface (not inside the constructor of the embedded interface).
#define | SCF_CONSTRUCT_IBASE(Parent)
| The SCF_CONSTRUCT_IBASE macro should be invoked inside the constructor of a class (not inside an embedded interface).
#define | SCF_CREATE_INSTANCE(ClassID, Interface) scfCreateInstance<Interface> (ClassID)
#define | SCF_DECLARE_EMBEDDED_IBASE(OuterClass)
| SCF_DECLARE_EMBEDDED_IBASE is used to declare the methods of iBase inside an embedded class that is exposed via QueryInterface.
#define | SCF_DECLARE_IBASE
| This macro should be embedded into any SCF-capable class definition to declare the minimal functionality required by iBase interface.
#define | SCF_DECLARE_IBASE_EXT(ParentClass)
| The following macro is used in "expansion SCF classes".
#define | SCF_DEFINE_FACTORY_FUNC_REGISTRATION(Class)
| Define the C++ class needed to register an SCF class, but don't do any automatic registration.
#define | SCF_DESTRUCT_EMBEDDED_IBASE(Interface)
| The SCF_DESTRUCT_EMBEDDED_IBASE macro should be invoked inside the destructor of a class that has an embedded interface (not inside the destructor of the embedded interface).
#define | SCF_DESTRUCT_IBASE()
| The SCF_DESTRUCT_IBASE macro should be invoked inside the destructor of a class (not inside an embedded interface).
#define | SCF_IMPLEMENT_EMBEDDED_IBASE(Class)
| SCF_IMPLEMENT_EMBEDDED_IBASE should be used to implement embedded interfaces derived from iBase.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_DECREF(Class)
| The SCF_IMPLEMENT_EMBEDDED_IBASE_DECREF() macro implements the DecRef() method for an embedded class in a C++ source module.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_END SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY_END
| The SCF_IMPLEMENT_EMBEDDED_IBASE_END macro is used to finish an SCF_IMPLEMENT_EMBEDDED_IBASE definition.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_GETREFCOUNT(Class)
| The SCF_IMPLEMENT_EMBEDDED_IBASE_GETREFCOUNT() macro implements the GetRefCount() method for an embedded class in a C++ source module.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_INCREF(Class)
| The SCF_IMPLEMENT_EMBEDDED_IBASE_INCREF() macro implements the IncRef() method for an embedded class in a C++ source module.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY(Class)
| The SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY() macro implements the opening boilerplate for the QueryInterface() method for an embedded class in a C++ source module.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY_END
| The SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY_END macro implements the closing boilerplate for the QueryInterface() method for a class in an embedded C++ source module.
#define | SCF_IMPLEMENT_EMBEDDED_IBASE_REFOWNER(Class)
| The SCF_IMPLEMENT_EMBEDDED_IBASE_REFOWNER() macro implements the AddRefOwner() and RemoveRefOwner() for a weak reference.
#define | SCF_IMPLEMENT_FACTORY(Class)
| The SCF_IMPLEMENT_FACTORY macro is used to define a factory for one of exported classes.
#define | SCF_IMPLEMENT_FACTORY_CREATE(Class)
| The SCF_IMPLEMENT_FACTORY_CREATE macro is used to define a factory for one of exported classes.
#define | SCF_IMPLEMENT_FACTORY_FINIS(Class)
| The SCF_IMPLEMENT_FACTORY_FINIS macro defines finalization code for a plugin module.
#define | SCF_IMPLEMENT_FACTORY_INIT(Class)
| The SCF_IMPLEMENT_FACTORY_INIT macro defines initialization code for a plugin module.
#define | SCF_IMPLEMENT_IBASE(Class)
| The SCF_IMPLEMENT_IBASE() macro should be used within the C++ source module that implements a interface derived from iBase.
#define | SCF_IMPLEMENT_IBASE_DECREF(Class)
| The SCF_IMPLEMENT_IBASE_DECREF() macro implements the DecRef() method for a class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_END SCF_IMPLEMENT_IBASE_QUERY_END
| The SCF_IMPLEMENT_IBASE_END macro is used to finish an SCF_IMPLEMENT_IBASE definition.
#define | SCF_IMPLEMENT_IBASE_EXT(Class)
| This macro implements same functionality as SCF_IMPLEMENT_IBASE except that it should be used for expansion SCF classes.
#define | SCF_IMPLEMENT_IBASE_EXT_DECREF(Class)
| The SCF_IMPLEMENT_IBASE_EXT_DECREF() macro implements the DecRef() method for a class extending another SCF class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_EXT_END SCF_IMPLEMENT_IBASE_EXT_QUERY_END
| This macro implements same functionality as SCF_IMPLEMENT_IBASE_END except that it is used for expansion SCF classes.
#define | SCF_IMPLEMENT_IBASE_EXT_GETREFCOUNT(Class)
| The SCF_IMPLEMENT_IBASE_EXT_GETREFCOUNT() macro implements the GetRefCount() method for a class extending another SCF class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_EXT_INCREF(Class)
| The SCF_IMPLEMENT_IBASE_EXT_INCREF() macro implements the IncRef() method for a class extending another SCF class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_EXT_QUERY(Class)
| The SCF_IMPLEMENT_IBASE_EXT_QUERY() macro implements the opening boilerplate for the QueryInterface() method for a class extending another SCF class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_EXT_QUERY_END
| The SCF_IMPLEMENT_IBASE_EXT_QUERY_END macro implements the closing boilerplate for the QueryInterface() method for a class extending another SCF class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_EXT_REFOWNER(Class)
| The SCF_IMPLEMENT_IBASE_EXT_REFOWNER() macro implements the AddRefOwner() and RemoveRefOwner() for a weak reference.
#define | SCF_IMPLEMENT_IBASE_GETREFCOUNT(Class)
| The SCF_IMPLEMENT_IBASE_GETREFCOUNT() macro implements GetRefCount() for a class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_INCREF(Class)
| The SCF_IMPLEMENT_IBASE_INCREF() macro implements the IncRef() method for a class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_QUERY(Class)
| The SCF_IMPLEMENT_IBASE_QUERY() macro implements the opening boilerplate for the QueryInterface() method for a class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_QUERY_END
| The SCF_IMPLEMENT_IBASE_QUERY_END macro implements the closing boilerplate for the QueryInterface() method for a class in a C++ source module.
#define | SCF_IMPLEMENT_IBASE_REFOWNER(Class)
| The SCF_IMPLEMENT_IBASE_REFOWNER() macro implements the AddRefOwner() and RemoveRefOwner() for a weak reference.
#define | SCF_IMPLEMENT_IBASE_REMOVE_REF_OWNERS(Class)
| The SCF_IMPLEMENT_IBASE_REMOVE_REF_OWNERS() macro implements the scfRemoveRefOwners() method for a class in a C++ source module.
#define | SCF_IMPLEMENTS_EMBEDDED_INTERFACE(Interface) SCF_IMPLEMENTS_INTERFACE_COMMON (Interface, (&scf##Interface))
| IMPLEMENT_EMBEDDED_INTERFACE is same as IMPLEMENT_INTERFACE but is used when class implements the interface as an embedded member.
#define | SCF_IMPLEMENTS_INTERFACE(Interface)
| The IMPLEMENT_INTERFACE macro is used inside QueryInterface function to check if user requested a specific interface, whenever requested version of the interface correspond to the version we have and to return a pointer to that interface if everything is correct.
#define | SCF_IMPLEMENTS_INTERFACE_COMMON(Interface, Object)
| This is a common macro used in all IMPLEMENTS_XXX_INTERFACE macros.
#define | SCF_INIT_TRACKER_ALIASES
#define | SCF_PRINT_CALL_ADDRESS
| Macro for getting the address we were called from (stack backtracing).
#define | SCF_QUERY_INTERFACE(Object, Interface) scfQueryInterface<Interface> (Object)
#define | SCF_QUERY_INTERFACE_SAFE(Object, Interface) scfQueryInterfaceSafe<Interface> (Object)
#define | SCF_REGISTER_FACTORY_FUNC(Class)
| Used in conjunction with SCF_REGISTER_STATIC_LIBRARY to ensure that a reference to the class(es) registered via SCF_REGISTER_STATIC_LIBRARY are actually linked into the application.
#define | SCF_REGISTER_STATIC_CLASS(Class, Ident, Desc, Dep)
| Automatically register a built-in class with SCF during startup.
#define | SCF_REGISTER_STATIC_LIBRARY(Module, MetaInfo)
| Automatically register a static library with SCF during startup.
#define | SCF_STATIC_CLASS_CONTEXT "*static*"
#define | SCF_TRACE(x)
| Macro for typing debug strings: Add #define SCF_DEBUG at the top of modules you want to track miscelaneous SCF activity and recompile.
#define | SCF_USE_STATIC_PLUGIN(Module)
| Register a statically linked plugin.

## Enumerations

enum | { SCF_VERBOSE_NONE = 0, SCF_VERBOSE_PLUGIN_SCAN = 1 << 0, SCF_VERBOSE_PLUGIN_LOAD = 1 << 1, SCF_VERBOSE_PLUGIN_REGISTER = 1 << 2, SCF_VERBOSE_CLASS_REGISTER = 1 << 3, SCF_VERBOSE_ALL = ~0 }
| SCF verbosity flags. More...

## Functions

template<class Interface>
csPtr< Interface > | scfCreateInstance (char const *const ClassID)
| Handy function to create an instance of a shared class.
void | scfInitialize (int argc, const char *const argv[])
| This function should be called to initialize client SCF library.
void | scfInitialize (csPathsList const *pluginPaths, unsigned int verbose=SCF_VERBOSE_NONE)
| This function should be called to initialize client SCF library.
template<class Interface, class ClassPtr>
csPtr< Interface > | scfQueryInterface (ClassPtr object)
| Helper function around iBase::QueryInterface.
template<class Interface, class ClassPtr>
csPtr< Interface > | scfQueryInterfaceSafe (ClassPtr object)
| Helper function around iBase::QueryInterface which also does null-check of object.

## Detailed Description

Crystal Space Shared Class Facility (SCF).

Definition in file scf.h.