Next: library_entry internals, Previous: The library_base const_iterator class, Up: Library framework
library
internalsDefault constructs a library holding a
NULL
library_base
pointer.
This constructor attempts to automatically detect what type of library filename is, and create an appropriate
library_base
to interpret it. For a library type to be correctly auto-detected a function of typelibrary::init_function
must be registered withlibrary::addtype
. After constructing a library, thelibrary::good
function can be used see if auto-detection succeeded.
This constructor is provided to allow libraries the flexibility not to use the auto-detection mechanism. The argument, lb, must have allocated by
new
and gets deleted by thelibrary
's destructor. For more information on how to use this, see Alternative creation mechanisms.
Functions with this signature are used by the
library
construtor to attempt to load a library. Each derived library class that supports auto-detection should register a function of this signature with thelibrary
class by calling thelibrary::addtype
function. When these functions get called, filename is the name of the library file. If a library can read the file it should return a pointer to a class derived fromlibrary_base
allocated withnew
; otherwise the function should return NULL.
This is used to register a specific (derived) library class to the list of classes that can be auto-detected. This function is typically called by the static function
registerlib
in the derived classes.
If the library holds a
library_base
, these function call down to the corresponding functions on that, otherwise both functions return a default constructedconst_iterator
.
This function returns true if the library is valid, and false otherwise.
These functions all call down to the corresponding functions on the
library_base
; see The library_base class for details. They must not be called iflibrary::good()
is false.