ObjectStore C++ API Reference

os_DLL_schema_info

This class provides access to information in a DLL about its DLL schema, including the pathname of the schema database, DLL identifiers, rep descriptors, pointers to vtbls, and so on. Its base class is os_schema_info.

Required header files
#include <ostore/nreloc/schftyps.hh>

os_DLL_schema_info::add_DLL_identifier()

void add_DLL_identifier(const char* id); 
Adds the specified DLL identifier to the set of DLL identifiers of the os_DLL_schema_info. This function can be called before os_DLL_schema_info::DLL_loaded() if the DLL identifier is determined independently of the schema.

This can be used, for example, in a case where one developer hands off the schema database, schema file, and other object files to another developer who incorporates these into a DLL that he builds. The schema starts with a dummy DLL identifier to make it a DLL schema, and has the real identifiers added by the second developer.

The add_DLL_identifier() function allocates a small amount of memory that is never freed. The amount of memory is proportional to the total number of DLL identifiers in the os_DLL_schema_info. It also retains a pointer to the id argument indefinitely.

os_DLL_schema_info::DLL_loaded()

os_schema_handle& DLL_loaded();
Notifies ObjectStore that a DLL has been loaded and that the DLL's schema must be loaded and merged into the process's complete program schema. The this argument identifies the schema to be loaded. Typically the this argument is an os_DLL_schema_info structure generated by ossg in the DLL that is calling DLL_loaded(). Typically the call is in the DLL's initialization function.

Upon notification, one of the following then occurs:

Aborting a transaction does not roll back os_DLL_schema_info::DLL_loaded().

The returned os_schema_handle represents the DLL schema that was or will be loaded.

Debugging
Delayed loading of DLL schema after calling os_DLL_schema_info::DLL_loaded() can raise exceptions. It can be difficult to debug these, because they occur later than the program action that loaded the DLL, but the error message should always include a DLL identifier of the DLL.

One way to debug such a program is to start a transaction and put a database in use to force deferred loading to happen.

os_schema_handle&  DLL_loaded(
      const char* explicit_schema_database_path
);
The explicit_schema_database_path argument allows the file pathname of the DLL schema database to be passed in, overriding the pathname in the os_DLL_schema_info. This calls os_DLL_schema_info::set_schema_database_pathname and then calls the no-arguments overloading of DLL_loaded described previously.

os_DLL_schema_info::DLL_unloaded()

void DLL_unloaded();
Uses the os_DLL_schema_info to locate a loaded os_schema_handle and calls os_schema_handle::DLL_unloaded().

An exception is thrown if no corresponding os_schema_handle currently exists.



[previous] [next]

Copyright © 1997 Object Design, Inc. All rights reserved.

Updated: 03/31/98 17:25:09