
Object cache:

(This is a 'how it will be' rather than 'how it is')


The main hashtable stores ObjectData instances, using "classname-objectid"
as the key. All objects are stored in this table once and only once, if they
are currently in the cache.


For rapid data searches, additional hash tables are stored for each required
index. A hash table stores a set of CacheIndex instances, where each
CacheInstance contains a description of the index


When an empty object is inserted, it will not appear in any indexes, as the
appropriate fields have not been set.

When an object is removed, the list of indexes that it belongs to is used to
remove it from all of those indexes. (Any indexes that then have 0 members
are in turn removed.)

When a field is set in an object, it must first be removed from any indexes
that include that field, the field can then be set, and then it must be
re-added to any indexes that include that field.




The key is made up of the contents of each field in the index.  (eg:
geas::listitem is indexed on listid and position. the key can be obtained
like this: char *key = g_strdup_printf("%s:%s",listid,position);



This system allows GEAS to search the cache for objects that are an exact
match for a number of fields, where all fields used are part of an index,
and the index contains no other fields.  (eg: a class indexed on the fields
'listid' and 'position' can be searched for using those two fields, but not
using just one of those fields, and not using any fields not in that index.)

TODO: Allowing more complex searching/indexing.

