| LPMtool - LPMtool is a Package Management tool | ||
|---|---|---|
| <<< Previous | Chapter 14. System Repository | Next >>> |
A
gdbm::ResourceDB
class is a protected subclass of the
gdbm class.
gdbm::ResourceDB
hides the raw record-based GDBM interface, and
replaces it with a slightly higher-level version.
Although the keys are still arbitrary strings,
instead of storing an arbitrary chunk of bytes,
gdbm::ResourceDB stores a set of
Dependency
objects.
The
gdbm::ResourceDB object
stores zero or more Dependency objects in the
underlying GDBM record, associated with a particular key,
and retrieves them upon demand.
Well, not exactly.
The gdbm::ResourceDB object does not actually store
new records in the underlying GDBM file.
The gdbm::ResourceDB object saves new records
in an internal buffer.
Subsequent requests for a record with the same key returns the saved
Dependency objects.
| NOTE: | An attempt to store an empty list of |
The gdbm::ResourceDB object's
commit method receives a
FileInstall object,
that actually records the updated records.
Later, when the
FileInstall gets commited, the
GDBM file gets actually updated with the new content.
| NOTE: | After storing the accumulated list of changed records in the
This is because the file is presently opened in read-only mode (the updated
records are not written to a file, they get saved in a buffer), and the
same GDBM file is going to be opened in read-write
mode very soon.
This means that the read-only file descriptor must be closed (together with
its corresponding lock file), so that the file can be reopened in
read-write mode
(after everything gets commited, if the same
|
| <<< Previous | Home | Next >>> |
| gdbm | Up | ResourceDB::gdbm |