Next: , Previous: Built-in library types, Up: Method libraries



5.3 Library framework

This section describes in greater detail how the various classes which implement method libraries interact. It is intended for those writing new classes to support new library types.

The basic library framework comprises five classes, all of which are declared in the header file ringing/library.h.

— Class: class library_base

This is the basic interface that all implementations will need to implement. It describes how to iterate through a library, and provides hooks that can be used to provide more efficient algorithms for searching through the library.

— Class: class library

The library class serves two purposes: it acts as a shared pointer to a library_base, and it handles the auto-detection of libraries. Implementations only need to derive from this if they want to provide an alternative to the standard auto-detection mechansim.

— Class: class library_entry

This class represents an entry in a library. It has value semantics; thus it is safe to hold onto multiple entries from a single library.

— Class: class library_base::const_iterator

This is an input iterator that iterates over the entries in a library. Dereferencing the iterator returns a library_entry.

— Class: class library_entry::impl

Each library_entry class holds onto a pointer to one of these. It provides an interface to read library entries that all library implementations must implement.