Next: library_entry internals, Previous: The library_base const_iterator class, Up: Library framework
library internalsDefault constructs a library holding a
NULLlibrary_basepointer.
This constructor attempts to automatically detect what type of library filename is, and create an appropriate
library_baseto interpret it. For a library type to be correctly auto-detected a function of typelibrary::init_functionmust be registered withlibrary::addtype. After constructing a library, thelibrary::goodfunction 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
newand 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
libraryconstrutor to attempt to load a library. Each derived library class that supports auto-detection should register a function of this signature with thelibraryclass by calling thelibrary::addtypefunction. 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_baseallocated 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
registerlibin 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.