#include <DataArchive.h>
Public Methods | |
| DataArchive (std::string const &fn, bool read, bool chain=true) | |
| Open a new data archive. | |
| ~DataArchive () | |
| Close the data archive and cleanup. | |
| void | addObject (Object &object, std::string const &path) |
| Add an object to the archive. | |
| void | finalize () |
| Write the entry table and close the data archive. | |
| bool | isFinalized () |
| Test if the data archive has been finalized. | |
| bool | isWrite () |
| Test if the archive is in read or write mode. | |
| void | setDefault () |
| Make this archive the "default" archive. | |
| const LinkBase | getObject (std::string const &path_str) |
| Create a new object from a path identifier string. | |
| const LinkBase | getObject (const Path &path, std::string const &path_str="") |
| Create a new object from a Path instance. | |
| std::string | getFileName () const |
| Get the full path of the archive file. | |
| std::vector< ObjectID > | getChildren (ObjectID const &id) const |
| Get all children of a given object id. | |
| std::vector< ObjectID > | getChildren (std::string const &path) const |
| Get all children of a given path. | |
| bool | hasObject (ObjectID const &id) const |
| Check for the existance of an object in the archive. | |
| bool | hasObject (std::string const &path) const |
| Check for the existance of an object in the archive. | |
| std::string | getPathString (ObjectID const &id) const |
| Get the path string corresponding to a give object id. | |
| std::vector< ObjectID > | getAllObjects () const |
| Get a list of all objects in the archive. | |
| std::vector< std::string > | getAllPathStrings () const |
| Get a list of all object paths in the archive. | |
| void | cleanStatic () |
| Remove unused static objects from the cache. | |
| InterfaceProxy * | getObjectInterface (ObjectID const &id, std::string const &path="") const |
| Return the interface proxy corresponding to the specified object in the archive. | |
| InterfaceProxy * | getObjectInterface (std::string const &path) const |
| Return the interface proxy corresponding to the specified object in the archive. | |
| void | dump () const |
| Dump arhcive information to stdout (for debugging). | |
Static Public Methods | |
| DataArchive * | getDefault () |
| Get the current default archive. | |
Protected Methods | |
| void | _addEntry (int offset, int length, ObjectID hash, std::string const &path) |
| Add a new entry to the object table. | |
| void | _addStatic (Object *ptr, std::string const &path_str, ObjectID key=0) |
| Add an object to the static object cache. | |
| LinkBase const * | _getStatic (ObjectID key) |
| Get an object from the static object cache. | |
| Object * | _createObject (ObjectID classhash) |
| Create an a new instance using a class identifier hash. | |
| const TableEntry * | _lookupPath (Path const &path, std::string const &path_str="") const |
| Find the table entry corresponding to a given object path. | |
| const TableEntry * | _lookupPath (ObjectID const &id, std::string const &path_str="") const |
| Find the table entry corresponding to a given object. | |
| DataManager * | getManager () const |
| Get the associated data manager instance, if any. | |
Friends | |
| class | LinkBase |
| class | DataManager |
The DataArchive class provides read and write access to data archive files. Write mode is primarily intended for use by the data complier. In read mode, objects can be created dynamically from their path strings, with all external data loaded and linked objects created transparently. Static objects are cached internally. All created objects are returned via smart-pointers.
|
||||||||||||||||
|
Open a new data archive.
|
|
|
Close the data archive and cleanup.
|
|
||||||||||||||||||||
|
Add a new entry to the object table.
|
|
||||||||||||||||
|
Add an object to the static object cache.
|
|
|
Create an a new instance using a class identifier hash.
|
|
|
Get an object from the static object cache.
|
|
||||||||||||
|
Find the table entry corresponding to a given object.
|
|
||||||||||||
|
Find the table entry corresponding to a given object path.
|
|
||||||||||||
|
Add an object to the archive.
|
|
|
Remove unused static objects from the cache. Call this method after many objects have been deleted to free any unused cache entries. |
|
|
Dump arhcive information to stdout (for debugging).
|
|
|
Write the entry table and close the data archive. This should only be called after writing objects to a data archive. Do not call this in read mode. |
|
|
Get a list of all objects in the archive.
|
|
|
Get a list of all object paths in the archive.
|
|
|
Get all children of a given path. For path "A:X.Y", returns all object id's "A:X.Y.*". The id's can be converted to human-readable form by getPathString().
|
|
|
Get all children of a given object id. For id "A:X.Y", returns all object id's "A:X.Y.*". The id's can be converted to human-readable form by getPathString().
|
|
|
Get the current default archive.
|
|
|
Get the full path of the archive file.
|
|
|
Get the associated data manager instance, if any.
|
|
||||||||||||
|
Create a new object from a Path instance.
|
|
|
Create a new object from a path identifier string.
|
|
|
Return the interface proxy corresponding to the specified object in the archive.
|
|
||||||||||||
|
Return the interface proxy corresponding to the specified object in the archive.
|
|
|
Get the path string corresponding to a give object id. This provides a human-readable path string that is useful for error and debugging messages.
|
|
|
Check for the existance of an object in the archive.
|
|
|
Check for the existance of an object in the archive.
|
|
|
Test if the data archive has been finalized.
|
|
|
Test if the archive is in read or write mode.
|
|
|
Make this archive the "default" archive. It will remain so until another archive is assigned or it is deleted (in which case the dafault reverts to NULL).
|
|
|
|
|
|
|
|
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage. Generated on Tue Oct 14 12:06:40 2003, using Doxygen 1.2.18. |