CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Shared Class Facility (SCF)


Compounds

struct  iBase
 This is the basic interface: all other interfaces should be derived from this one, this will allow us to always use at least some minimal functionality given any interface pointer. More...

struct  scfClassInfo
 The shared library loader expects an array of such structures to be exported from each shared library. More...

struct  iComponent
 This interface describes a generic component in Crystal Space. More...

struct  iFactory
 iFactory is a interface that is used to create instances of shared classes. More...

struct  iObjectRegistry
 This interface serves as a registry of other objects. More...

struct  iObjectRegistryIterator
 Use an instance of this class to iterate over objects in the object registry. More...

struct  iPluginIterator
 An iterator to iterate over all plugins in the plugin manager. More...

struct  iPluginManager
 This is the plugin manager. More...

struct  iSCF
 iSCF is the interface that allows using SCF functions from shared classes. More...


Defines

#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. More...

#define SCF_PRINT_CALL_ADDRESS
 Macro for getting the address we were called from (stack backtracing). More...

#define SCF_CONSTRUCT_VERSION(Major, Minor, Micro)   ((Major << 24) | (Minor << 16) | Micro)
 Use this macro to construct interface version numbers. More...

#define SCF_INC_REF(ptr)   {if (ptr) {ptr->IncRef();}}
 This macro should make use of IncRef() safer. More...

#define SCF_DEC_REF(ptr)   {if (ptr) {ptr->DecRef();}}
 This macro should make use of DecRef() safer. More...

#define SCF_SET_REF(var, ref)
 This macro should be used to change the reference inside a variable. More...

#define SCF_DECLARE_IBASE
 This macro should be embedded into any SCF-capable class definition to declare the minimal functionality required by iBase interface. More...

#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... More...

#define SCF_CONSTRUCT_IBASE(Parent)   scfRefCount = 1; scfParent = Parent; if (scfParent) scfParent->IncRef();
 The SCF_CONSTRUCT_IBASE macro should be invoked inside the constructor of an exported class (not inside an embedded interface). More...

#define SCF_CONSTRUCT_EMBEDDED_IBASE(Interface)   Interface.scfParent = this;
 The SCF_CONSTRUCT_EMBEDDED_IBASE macro should be invoked inside the constructor of an exported class that has exported embedded interfaces (not inside the constructor of the embedded interface). More...

#define SCF_IMPLEMENT_IBASE_INCREF(Class)
 The SCF_IMPLEMENT_IBASE_INCREF() macro implements the IncRef() method for a class in a C++ source module. More...

#define SCF_IMPLEMENT_IBASE_DECREF(Class)
 The SCF_IMPLEMENT_IBASE_DECREF() macro implements the DecRef() method for a class in a C++ source module. More...

#define SCF_IMPLEMENT_IBASE_GETREFCOUNT(Class)
 The SCF_IMPLEMENT_IBASE_GETREFCOUNT() macro implements GetRefCount() for a class in a C++ source module. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#define SCF_IMPLEMENT_EMBEDDED_IBASE(Class)
 SCF_IMPLEMENT_EMBEDDED_IBASE should be used to implement embedded interfaces derived from iBase. More...

#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. More...

#define SCF_IMPLEMENTS_INTERFACE(Interface)   SCF_IMPLEMENTS_INTERFACE_COMMON (Interface, this)
 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. More...

#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. More...

#define SCF_IMPLEMENTS_INTERFACE_COMMON(Interface, Object)
 This is a common macro used in all IMPLEMENTS_XXX_INTERFACE macros. More...

#define SCF_DECLARE_IBASE_EXT(ParentClass)
 The following macro is used in "expansion SCF classes". More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#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. More...

#define SCF_IMPLEMENT_FACTORY(Class)
 The SCF_IMPLEMENT_FACTORY macro is used to define a factory for one of exported classes. More...

#define SCF_DECLARE_FACTORY(Class)   void* Class##_Create (iBase *iParent);
 The SCF_DECLARE_FACTORY macro is used to provide a forward definition if SCF_IMPLEMENT_FACTORY is declared in another file. More...

#define SCF_EXPORT_CLASS_TABLE(LibraryName)
 Define the start of class export table. More...

#define SCF_EXPORT_CLASS(Class, ClassID, Description)   { ClassID, Description, NULL, Class##_Create },
 Add information about a exported class into the table. More...

#define SCF_EXPORT_CLASS_DEP(Class, ClassID, Description, Dependencies)   { ClassID, Description, Dependencies, Class##_Create },
 Add information about an exported class and dependency info into table. More...

#define SCF_EXPORT_CLASS_TABLE_END
 Finish the definition of exported class table. More...

#define SCF_REGISTER_STATIC_LIBRARY(LibraryName)
 Automatically register a static library with SCF during startup. More...

#define SCF_REGISTER_STATIC_CLASS(Class, ClassID, Description)   SCF_REGISTER_STATIC_CLASS_DEP (Class,ClassID,Description,NULL);
 This macro is similar to SCF_REGISTER_STATIC_LIBRARY, but registers a single class. More...

#define SCF_REGISTER_STATIC_CLASS_DEP(Class, ClassID, Description, Dependency)
 This is similar to SCF_REGISTER_STATIC_CLASS except that you can provide an additional argument specifying the class dependencies. More...

#define SCF_CREATE_INSTANCE(ClassID, Interface)
 Handy macro to create an instance of a shared class. More...

#define SCF_VERSION(Name, Major, Minor, Micro)
 SCF_VERSION can be used as a shorter way to define an interface version; you should specify interface name and major, minor and micro version components. More...

#define SCF_QUERY_INTERFACE(Object, Interface)
 Shortcut macro to query given interface from given object. More...

#define SCF_QUERY_INTERFACE_SAFE(Object, Interface)
 Shortcut macro to query given interface from given object. More...

#define CS_QUERY_PLUGIN_CLASS(Object, ClassID, Interface)
 Find a plugin by his class ID. More...

#define CS_LOAD_PLUGIN(Object, ClassID, Interface)
 Tell plugin manager driver to load a plugin. More...

#define CS_LOAD_PLUGIN_ALWAYS(Object, ClassID)   csPtr<iBase> ((Object)->LoadPlugin (ClassID, NULL, 0))
 Same as CS_LOAD_PLUGIN but don't bother asking for a interface. More...


Typedefs

typedef uint32 scfInterfaceID
 Type of registered interface handle used by iBase::QueryInterface(). More...


Functions

void scfInitialize (iConfigFile *iConfig=0)
 This function should be called to initialize client SCF library. More...

bool scfCompatibleVersion (int iVersion, int iItfVersion)
 This function checks whenever an interface is compatible with given version. More...


Define Documentation

#define CS_LOAD_PLUGIN Object,
ClassID,
Interface   
 

Value:

csPtr<Interface> ((Interface *)((Object)->LoadPlugin                    \
  (ClassID, #Interface, Interface##_VERSION)))
Tell plugin manager driver to load a plugin.

`Object' is a object that implements iPluginManager interface. `ClassID' is the class ID (`crystalspace.graphics3d.software'). `Interface' is a interface name (iGraphics2D, iVFS and so on).

Definition at line 51 of file plugin.h.

#define CS_LOAD_PLUGIN_ALWAYS Object,
ClassID       csPtr<iBase> ((Object)->LoadPlugin (ClassID, NULL, 0))
 

Same as CS_LOAD_PLUGIN but don't bother asking for a interface.

This is useful for unconditionally loading plugins.

Definition at line 72 of file plugin.h.

#define CS_QUERY_PLUGIN_CLASS Object,
ClassID,
Interface   
 

Value:

csPtr<Interface> ((Interface *)((Object)->QueryPlugin                   \
  (ClassID, #Interface, Interface##_VERSION)))
Find a plugin by his class ID.

First the plugin with requested class identifier is found, and after this it is queried for the respective interface; if it does not implement the requested interface, NULL is returned.

Definition at line 41 of file plugin.h.

#define CS_QUERY_REGISTRY Reg,
Interface   
 

Value:

csPtr<Interface> ((Interface*)(CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (#Interface, \
    Interface##_scfGetID (), Interface##_VERSION)))

Definition at line 34 of file iutil/objreg.h.

#define CS_QUERY_REGISTRY_TAG_INTERFACE Reg,
Tag,
Interface   
 

Value:

csPtr<Interface> ((Interface*)(CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (Tag,    \
    Interface##_scfGetID (), Interface##_VERSION)))

Definition at line 37 of file iutil/objreg.h.

#define SCF_CONSTRUCT_EMBEDDED_IBASE Interface       Interface.scfParent = this;
 

The SCF_CONSTRUCT_EMBEDDED_IBASE macro should be invoked inside the constructor of an exported class that has exported embedded interfaces (not inside the constructor of the embedded interface).

The macro will and initialize the pointer to the parent object (to the object this one is embedded into).

Definition at line 154 of file scf.h.

Referenced by csDataObject::csDataObject, and csSharedVariable::csSharedVariable.

#define SCF_CONSTRUCT_IBASE Parent       scfRefCount = 1; scfParent = Parent; if (scfParent) scfParent->IncRef();
 

The SCF_CONSTRUCT_IBASE macro should be invoked inside the constructor of an exported class (not inside an embedded interface).

Normally each constructor should accept an iBase* parameter (that is passed by scfCreateInstance function) which should be passed to this macro. The macro will zero the reference count and initialize the pointer to the parent object.

Definition at line 144 of file scf.h.

Referenced by csDataBuffer::csDataBuffer, csDataObject::csDataObject, csInputBinderBoolean::csInputBinderBoolean, csInputBinderPosition::csInputBinderPosition, scfString::scfString, and scfStrVector::scfStrVector.

#define SCF_CONSTRUCT_VERSION Major,
Minor,
Micro       ((Major << 24) | (Minor << 16) | Micro)
 

Use this macro to construct interface version numbers.

Definition at line 68 of file scf.h.

#define SCF_CREATE_INSTANCE ClassID,
Interface   
 

Value:

(Interface *)iSCF::SCF->CreateInstance (                                \
  ClassID, #Interface, Interface##_VERSION)
Handy macro to create an instance of a shared class.

This is a simple wrapper around scfCreateInstance.

Definition at line 611 of file scf.h.

#define SCF_DEC_REF ptr       {if (ptr) {ptr->DecRef();}}
 

This macro should make use of DecRef() safer.

Definition at line 102 of file scf.h.

#define SCF_DECLARE_EMBEDDED_IBASE OuterClass   
 

Value:

public:                                                                 \
  OuterClass *scfParent;                                \
  virtual void IncRef ();                                               \
  virtual void DecRef ();                                               \
  virtual int GetRefCount ();                                           \
  virtual void *QueryInterface (scfInterfaceID iInterfaceID, int iVersion)
SCF_DECLARE_EMBEDDED_IBASE is used to declare the methods of iBase inside an embedded class that is exposed via QueryInterface...

Definition at line 128 of file scf.h.

#define SCF_DECLARE_FACTORY Class       void* Class##_Create (iBase *iParent);
 

The SCF_DECLARE_FACTORY macro is used to provide a forward definition if SCF_IMPLEMENT_FACTORY is declared in another file.

Definition at line 458 of file scf.h.

#define SCF_DECLARE_IBASE
 

Value:

int scfRefCount;                                        \
  SCF_DECLARE_EMBEDDED_IBASE (iBase)
This macro should be embedded into any SCF-capable class definition to declare the minimal functionality required by iBase interface.

Definition at line 120 of file scf.h.

#define SCF_DECLARE_IBASE_EXT ParentClass   
 

Value:

typedef ParentClass __scf_superclass;                                   \
  virtual void IncRef ();                                               \
  virtual void DecRef ();                                               \
  virtual int GetRefCount ();                                           \
  virtual void *QueryInterface (scfInterfaceID iInterfaceID, int iVersion)
The following macro is used in "expansion SCF classes".

An expansion class is a class that extends the functionality of another SCF class. For example, suppose a class TheWolf that implements the iWolf interface. Separately it is a useful class per se, but if you want to implement an additional class TheDog that is a subclass of TheWolf and which implements an additional interface iDog in theory you should just override the QueryInterface method and return the corresponding pointer when asked. The following macro makes such overrides simpler to write.

Definition at line 360 of file scf.h.

#define SCF_EXPORT_CLASS Class,
ClassID,
Description       { ClassID, Description, NULL, Class##_Create },
 

Add information about a exported class into the table.

Definition at line 519 of file scf.h.

#define SCF_EXPORT_CLASS_DEP Class,
ClassID,
Description,
Dependencies       { ClassID, Description, Dependencies, Class##_Create },
 

Add information about an exported class and dependency info into table.

Definition at line 523 of file scf.h.

#define SCF_EXPORT_CLASS_TABLE LibraryName   
 

Value:

CS_DECLARE_STATIC_VARIABLE_CLEANUP                                      \
CS_EXPORTED_FUNCTION void                                               \
CS_EXPORTED_NAME(LibraryName,_scfFinalize)()                            \
{ CS_STATIC_VARIABLE_CLEANUP }                                          \
static inline void                                                      \
CS_EXPORTED_NAME(LibraryName,_scfUnitInitialize)(iSCF *SCF)             \
{ iSCF::SCF = SCF; }                                                    \
CS_EXPORTED_FUNCTION scfClassInfo*                                      \
CS_EXPORTED_NAME(LibraryName,_scfInitialize)(iSCF *SCF)                 \
{                                                                       \
  CS_EXPORTED_NAME(LibraryName,_scfUnitInitialize)(SCF);                \
  static scfClassInfo ExportClassTable [] =                             \
  {
Define the start of class export table.

Any module that exports a number of SCF classes can define a table with a list ot all classes exported from this module. The LibraryName parameter is used to construct the name of the table variable; usually the table is returned by a function called LibraryName_scfInitialize(). This function also initializes the global (iSCF::SCF) pointer for each module. This ensures that iSCF::SCF will have a valid value in all loaded plugin modules. Note that there are some very rare instances where a particularly picky (and probably buggy) compiler does not allow C++ expressions within a function declared `extern "C"'. For this reason, the iSCF::SCF variable is instead initialized in the LibraryName_scfUnitInitialize() function which is not qualified as `extern "C"'.

Definition at line 503 of file scf.h.

#define SCF_EXPORT_CLASS_TABLE_END
 

Value:

{ 0, 0, 0, 0 }                                                  \
  };                                                                    \
  return ExportClassTable;                                              \
}
Finish the definition of exported class table.

Definition at line 527 of file scf.h.

#define SCF_IMPLEMENT_EMBEDDED_IBASE Class   
 

Value:

SCF_IMPLEMENT_EMBEDDED_IBASE should be used to implement embedded interfaces derived from iBase.

It differs from SCF_IMPLEMENT_IBASE because embedded interface don't have reference counts themselves, but instead use the reference count of their parent object.

Definition at line 307 of file scf.h.

#define SCF_IMPLEMENT_EMBEDDED_IBASE_DECREF Class   
 

Value:

void Class::DecRef ()                                                   \
{                                                                       \
  SCF_TRACE (("  (%s *)%p->DecRef (%d)\n", #Class, this,                \
              scfParent->GetRefCount ()-1));                            \
  scfParent->DecRef ();                                                 \
}
The SCF_IMPLEMENT_EMBEDDED_IBASE_DECREF() macro implements the DecRef() method for an embedded class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_EMBEDDED_IBASE() convenience macro.

Definition at line 261 of file scf.h.

#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.

Definition at line 317 of file scf.h.

#define SCF_IMPLEMENT_EMBEDDED_IBASE_GETREFCOUNT Class   
 

Value:

int Class::GetRefCount ()                                               \
{                                                                       \
  return scfParent->GetRefCount ();                                     \
}
The SCF_IMPLEMENT_EMBEDDED_IBASE_GETREFCOUNT() macro implements the GetRefCount() method for an embedded class in a C++ source module.

Definition at line 273 of file scf.h.

#define SCF_IMPLEMENT_EMBEDDED_IBASE_INCREF Class   
 

Value:

void Class::IncRef ()                                                   \
{                                                                       \
  SCF_TRACE (("  (%s *)%p->IncRef (%d)\n", #Class, this,                \
    scfParent->GetRefCount () + 1));                                    \
  scfParent->IncRef ();                                                 \
}
The SCF_IMPLEMENT_EMBEDDED_IBASE_INCREF() macro implements the IncRef() method for an embedded class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_EMBEDDED_IBASE() convenience macro.

Definition at line 247 of file scf.h.

#define SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY Class   
 

Value:

void *Class::QueryInterface (scfInterfaceID iInterfaceID, int iVersion) \
{                                                                       \
  SCF_TRACE (("  (%s *)%p->QueryInterface (%u, %08X)\n",                \
    #Class, this, iInterfaceID, iVersion));
The SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY() macro implements the opening boilerplate for the QueryInterface() method for an embedded class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_EMBEDDED_IBASE() convenience macro.

Definition at line 285 of file scf.h.

#define SCF_IMPLEMENT_EMBEDDED_IBASE_QUERY_END
 

Value:

return scfParent->QueryInterface (iInterfaceID, iVersion);              \
}
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.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_EMBEDDED_IBASE_END convenience macro.

Definition at line 297 of file scf.h.

#define SCF_IMPLEMENT_FACTORY Class   
 

Value:

void *Class##_Create (iBase *iParent)                                   \
{                                                                       \
  void *ret = new Class (iParent);                                      \
  SCF_TRACE (("  %p = new %s ()\n", ret, #Class));                      \
  return ret;                                                           \
}
The SCF_IMPLEMENT_FACTORY macro is used to define a factory for one of exported classes.

You can define the function manually, of course, if the constructor for your class has some specific constructor arguments (that is, more than one iBase* argument).

Definition at line 446 of file scf.h.

#define SCF_IMPLEMENT_IBASE Class   
 

Value:

The SCF_IMPLEMENT_IBASE() macro should be used within the C++ source module that implements a interface derived from iBase.

Of course, you can still implement those methods manually, if you desire ...

Definition at line 228 of file scf.h.

#define SCF_IMPLEMENT_IBASE_DECREF Class   
 

Value:

void Class::DecRef ()                                                   \
{                                                                       \
  if (scfRefCount == 1)                                                 \
  {                                                                     \
    SCF_TRACE ((" delete (%s *)%p\n", #Class, this));                   \
    if (scfParent)                                                      \
      scfParent->DecRef ();                                             \
    delete this;                                                        \
    return;                                                             \
  }                                                                     \
  scfRefCount--;                                                        \
}
The SCF_IMPLEMENT_IBASE_DECREF() macro implements the DecRef() method for a class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE() convenience macro.

Definition at line 176 of file scf.h.

#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.

Definition at line 238 of file scf.h.

#define SCF_IMPLEMENT_IBASE_EXT Class   
 

Value:

This macro implements same functionality as SCF_IMPLEMENT_IBASE except that it should be used for expansion SCF classes.

Definition at line 427 of file scf.h.

#define SCF_IMPLEMENT_IBASE_EXT_DECREF Class   
 

Value:

void Class::DecRef ()                                                   \
{                                                                       \
  __scf_superclass::DecRef ();                                          \
}
The SCF_IMPLEMENT_IBASE_EXT_DECREF() macro implements the DecRef() method for a class extending another SCF class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE_EXT() convenience macro.

Definition at line 385 of file scf.h.

#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.

Definition at line 437 of file scf.h.

#define SCF_IMPLEMENT_IBASE_EXT_GETREFCOUNT Class   
 

Value:

int Class::GetRefCount ()                                               \
{                                                                       \
  return __scf_superclass::GetRefCount ();                              \
}
The SCF_IMPLEMENT_IBASE_EXT_GETREFCOUNT() macro implements the GetRefCount() method for a class extending another SCF class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE_EXT() convenience macro.

Definition at line 397 of file scf.h.

#define SCF_IMPLEMENT_IBASE_EXT_INCREF Class   
 

Value:

void Class::IncRef ()                                                   \
{                                                                       \
  __scf_superclass::IncRef ();                                          \
}
The SCF_IMPLEMENT_IBASE_EXT_INCREF() macro implements the IncRef() method for a class extending another SCF class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE_EXT() convenience macro.

Definition at line 373 of file scf.h.

#define SCF_IMPLEMENT_IBASE_EXT_QUERY Class   
 

Value:

void *Class::QueryInterface (scfInterfaceID iInterfaceID, int iVersion) \
{
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.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE_EXT() convenience macro.

Definition at line 409 of file scf.h.

#define SCF_IMPLEMENT_IBASE_EXT_QUERY_END
 

Value:

return __scf_superclass::QueryInterface (iInterfaceID, iVersion);       \
}
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.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE_EXT_END convenience macro.

Definition at line 419 of file scf.h.

#define SCF_IMPLEMENT_IBASE_GETREFCOUNT Class   
 

Value:

int Class::GetRefCount ()                                               \
{                                                                       \
  return scfRefCount;                                                   \
}
The SCF_IMPLEMENT_IBASE_GETREFCOUNT() macro implements GetRefCount() for a class in a C++ source module.

Definition at line 194 of file scf.h.

#define SCF_IMPLEMENT_IBASE_INCREF Class   
 

Value:

void Class::IncRef ()                                                   \
{                                                                       \
  SCF_TRACE (("  (%s *)%p->IncRef (%d)\n", #Class, this, scfRefCount + 1));\
  scfRefCount++;                                                        \
}
The SCF_IMPLEMENT_IBASE_INCREF() macro implements the IncRef() method for a class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE() convenience macro.

Definition at line 162 of file scf.h.

#define SCF_IMPLEMENT_IBASE_QUERY Class   
 

Value:

void *Class::QueryInterface (scfInterfaceID iInterfaceID, int iVersion) \
{                                                                       \
  SCF_TRACE (("  (%s *)%p->QueryInterface (%u, %08X)\n",                \
    #Class, this, iInterfaceID, iVersion));
The SCF_IMPLEMENT_IBASE_QUERY() macro implements the opening boilerplate for the QueryInterface() method for a class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE() convenience macro.

Definition at line 206 of file scf.h.

#define SCF_IMPLEMENT_IBASE_QUERY_END
 

Value:

return scfParent ?                                                      \
    scfParent->QueryInterface (iInterfaceID, iVersion) : NULL;          \
}
The SCF_IMPLEMENT_IBASE_QUERY_END macro implements the closing boilerplate for the QueryInterface() method for a class in a C++ source module.

Typically, this macro is automatically employed by the SCF_IMPLEMENT_IBASE_END convenience macro.

Definition at line 218 of file scf.h.

#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.

Definition at line 333 of file scf.h.

#define SCF_IMPLEMENTS_INTERFACE Interface       SCF_IMPLEMENTS_INTERFACE_COMMON (Interface, this)
 

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.

Definition at line 326 of file scf.h.

#define SCF_IMPLEMENTS_INTERFACE_COMMON Interface,
Object   
 

Value:

static scfInterfaceID Interface##_scfID = (scfInterfaceID)-1;           \
  if (Interface##_scfID == (scfInterfaceID)-1)                          \
    Interface##_scfID = iSCF::SCF->GetInterfaceID (#Interface);         \
  if (iInterfaceID == Interface##_scfID &&                              \
    scfCompatibleVersion (iVersion, Interface##_VERSION))               \
  {                                                                     \
    (Object)->IncRef ();                                                \
    return STATIC_CAST(Interface*, Object);                             \
  }
This is a common macro used in all IMPLEMENTS_XXX_INTERFACE macros.

Definition at line 339 of file scf.h.

#define SCF_INC_REF ptr       {if (ptr) {ptr->IncRef();}}
 

This macro should make use of IncRef() safer.

Definition at line 99 of file scf.h.

#define SCF_PRINT_CALL_ADDRESS
 

Macro for getting the address we were called from (stack backtracing).

This works ONLY For GCC >= 2.8.0

Definition at line 64 of file scf.h.

#define SCF_QUERY_INTERFACE Object,
Interface   
 

Value:

csPtr<Interface> ((Interface *)(Object)->QueryInterface (               \
  Interface##_scfGetID (), Interface##_VERSION))
Shortcut macro to query given interface from given object.

This is a wrapper around iBase::QueryInterface method.

Definition at line 641 of file scf.h.

#define SCF_QUERY_INTERFACE_SAFE Object,
Interface   
 

Value:

csPtr<Interface> ((Interface *)(iBase::QueryInterfaceSafe ((Object),    \
  Interface##_scfGetID (), Interface##_VERSION)))
Shortcut macro to query given interface from given object.

This is a wrapper around iBase::QueryInterface method. This version tests if Object is NULL and will return NULL in that case.

Definition at line 650 of file scf.h.

#define SCF_REGISTER_STATIC_CLASS Class,
ClassID,
Description       SCF_REGISTER_STATIC_CLASS_DEP (Class,ClassID,Description,NULL);
 

This macro is similar to SCF_REGISTER_STATIC_LIBRARY, but registers a single class.

You also should provide a ClassID and a description since a valid scfClassInfo structure should be created.

Definition at line 555 of file scf.h.

#define SCF_REGISTER_STATIC_CLASS_DEP Class,
ClassID,
Description,
Dependency   
 

Value:

extern void *Class##_Create (iBase *);                          \
  static scfClassInfo Class##_ClassInfo =                               \
  { ClassID, Description, Dependency, Class##_Create };                 \
  class Class##_Init__                                          \
  {                                                                     \
  public:                                                               \
    Class##_Init__ ()                                                   \
    { if (!iSCF::SCF) scfInitialize ();                                 \
      iSCF::SCF->RegisterStaticClass (&Class##_ClassInfo); }            \
  } Class##_dummy__;
This is similar to SCF_REGISTER_STATIC_CLASS except that you can provide an additional argument specifying the class dependencies.

Definition at line 562 of file scf.h.

#define SCF_REGISTER_STATIC_LIBRARY LibraryName   
 

Value:

extern "C" scfClassInfo *LibraryName##_scfInitialize (iSCF*);           \
  class __##LibraryName##_Init                                          \
  {                                                                     \
  public:                                                               \
    __##LibraryName##_Init ()                                           \
    { if (!iSCF::SCF) scfInitialize ();                                 \
      iSCF::SCF->RegisterClassList(LibraryName##_scfInitialize(iSCF::SCF)); }\
  } __##LibraryName##_dummy;
Automatically register a static library with SCF during startup.

When SCF classes are statically linked (vs dynamic linking) they should be referenced from somewhere inside your program, otherwise the static libraries won't be linked into the static executable. This macro defines a dummy variable that registers given library during initialization.

Definition at line 540 of file scf.h.

#define SCF_SET_REF var,
ref   
 

Value:

{ \
    if (ref) ref->IncRef (); \
    if (var) var->DecRef (); \
    var = ref; \
  }
This macro should be used to change the reference inside a variable.

The old reference will be DecRef()'ed and the new reference will be IncRef()'ed.

Definition at line 109 of file scf.h.

Referenced by csGenerateImageValueFunc::SetFunction, and csTextureWrapper::SetUseCallback.

#define SCF_TRACE  
 

Macro for typing debug strings: Add define SCF_DEBUG at the top of modules you want to track miscelaneous SCF activity and recompile.

Definition at line 53 of file scf.h.

#define SCF_VERSION Name,
Major,
Minor,
Micro   
 

Value:

const int Name##_VERSION = SCF_CONSTRUCT_VERSION (Major, Minor, Micro); \
inline static scfInterfaceID Name##_scfGetID ()                         \
{                                                                       \
  static scfInterfaceID ID = (scfInterfaceID)-1;                        \
  if (ID == (scfInterfaceID)(-1))                                       \
    ID = iSCF::SCF->GetInterfaceID (#Name);                             \
  return ID;                                                            \
}
SCF_VERSION can be used as a shorter way to define an interface version; you should specify interface name and major, minor and micro version components.

This way:

 SCF_VERSION (iSomething, 0, 0, 1);
 struct iSomething : public iBase
 {
   ...
 };
 

Definition at line 627 of file scf.h.


Typedef Documentation

typedef uint32 scfInterfaceID
 

Type of registered interface handle used by iBase::QueryInterface().

Definition at line 40 of file scf.h.

Referenced by iBase::QueryInterfaceSafe.


Function Documentation

bool scfCompatibleVersion int    iVersion,
int    iItfVersion
[inline, static]
 

This function checks whenever an interface is compatible with given version.

SCF uses the following comparison criteria: if the major version numbers are equal and required minor and micro version is less or equal than target version minor and micro numbers, the versions are considered compatible.

Definition at line 669 of file scf.h.

void scfInitialize iConfigFile   iConfig = 0
 

This function should be called to initialize client SCF library.

If you provide a iConfig object, the SCF-related registry section will be read from it. It is legal to call scfInitialize more than once (possibly providing a different iConfig object each time). If you don't specify this parameter, this argument is ignored.


Generated for Crystal Space by doxygen 1.2.14