CEL

Public API Reference

celInitializer Class Reference

This class contains static member functions which can help set up an application to use the Crystal Entity Layer. More...

#include <celtool/initapp.h>

List of all members.

Static Public Member Functions

static bool RequestPlugins (iObjectRegistry *, csArray< csPluginRequest > const &)
 A convenience wrapper for csInitializer::RequestPlugins() which first invokes celInitializer::SetupCelPluginDirs() and also loads cel vfs file through celInitializer::SetupVFS().
static bool RequestPlugins (iObjectRegistry *,...)
 A convenience wrapper for csInitializer::RequestPlugins() which first invokes celInitializer::SetupCelPluginDirs() and also loads cel vfs file through celInitializer::SetupVFS().
static bool RequestPluginsV (iObjectRegistry *, va_list)
 This is just like RequestPlugins(.
static void SetupCelPluginDirs (iObjectRegistry *r)
 Instructs SCF to also scan the CEL plugin directory or directories.
static bool SetupConfigManager (iObjectRegistry *r, char const *configName, char const *AppID=0)
 A convenience wrapper for csInitializer::SetupConfigManager() which makes sure cel vfs.cfg is loaded so config files can be loaded from cel vfs.
static iVFS * SetupVFS (iObjectRegistry *objectReg, const char *pluginID="crystalspace.kernel.vfs")
 A convenience wrapper for csInitializer::SetupVFS that will also load cel vfs.cfg file.


Detailed Description

This class contains static member functions which can help set up an application to use the Crystal Entity Layer.

It is possible to do all the setup on your own but using these utility methods will considerably simplify the task.

Definition at line 39 of file initapp.h.


Member Function Documentation

static bool celInitializer::RequestPlugins ( iObjectRegistry *  ,
csArray< csPluginRequest > const &   
) [static]

A convenience wrapper for csInitializer::RequestPlugins() which first invokes celInitializer::SetupCelPluginDirs() and also loads cel vfs file through celInitializer::SetupVFS().

Unlike the variable-argument RequestPlugins(...) method which expects you to know the list of requested plugins at compile-time, this overload allows you to construct an array of plugins at run-time. You do this by constructing a csArray<> of csPluginRequest records (see <cstool/initapp.h>). For example:

 csArray<csPluginRequest> a;
 a.Push(csPluginRequest(CS_REQUEST_VFS));
 a.Push(csPluginRequest(CS_REQUEST_ENGINE));
 a.Push(csPluginRequest(CS_REQUEST_PLUGIN("myproj.foobar",iFoobar)));
 celInitializer::RequestPlugins(registry,a);
WARNING csArray<> already knows its own size, so do not terminate the list with CS_REQUEST_END.

static bool celInitializer::RequestPlugins ( iObjectRegistry *  ,
  ... 
) [static]

A convenience wrapper for csInitializer::RequestPlugins() which first invokes celInitializer::SetupCelPluginDirs() and also loads cel vfs file through celInitializer::SetupVFS().

The variable arguments should contain four entries for every plugin you wish to load: SCF class name, SCF interface name, inteface ID, and interface version. To make this easier it is recommended that you use one of the CS_REQUEST_xxx macros (see <cstool/initapp.h>). WARNING Be sure to terminate the list with CS_REQUEST_END!

static bool celInitializer::RequestPluginsV ( iObjectRegistry *  ,
va_list   
) [static]

This is just like RequestPlugins(.

..), which accepts a variable list of arguments at compile-time, except that arguments are passed as a `va_list'.

static void celInitializer::SetupCelPluginDirs ( iObjectRegistry *  r  )  [inline, static]

Instructs SCF to also scan the CEL plugin directory or directories.

This method is invoked automatically by celInitializer::RequestPlugins(), so you do not normally need to call it. You may, however, want to call it if you do not utilize celInitializer::RequestPlugins(). If you do call it manually, it usually is wise to do so before invoking the underlying csInitializer::RequestPlugins() or CS_REQUEST_PLUGIN().

The following are queried in an attempt to locate the CEL plugin directory:

  • The CEL environment variable (as well as several likely subdirectories of the mentioned path).
  • The CEL_PLUGIN_DIR compile-time constant, if available. The typical way to define this property is to have the configure.ac script invoke AC_PATH_CEL or CS_PATH_CEL (defined in cel.m4) and to then "substitute" the discovered value of the plugin directory into the generated config.h file as follows:
           CS_PATH_CEL([someversion], [], [AC_MSG_ERROR([Failed to find CEL])])
           AC_DEFINE_UNQUOTED([CEL_PLUGIN_DIR], ["$CEL_PLUGIN_DIR"],
             [Define with path to CEL plugins.])
    

Definition at line 72 of file initapp.h.

static bool celInitializer::SetupConfigManager ( iObjectRegistry *  r,
char const *  configName,
char const *  AppID = 0 
) [static]

A convenience wrapper for csInitializer::SetupConfigManager() which makes sure cel vfs.cfg is loaded so config files can be loaded from cel vfs.

static iVFS* celInitializer::SetupVFS ( iObjectRegistry *  objectReg,
const char *  pluginID = "crystalspace.kernel.vfs" 
) [static]

A convenience wrapper for csInitializer::SetupVFS that will also load cel vfs.cfg file.


The documentation for this class was generated from the following file:
Generated for CEL: Crystal Entity Layer by doxygen 1.4.7