MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
|
#include <ElementRegistry.h>
Public Types | |
enum | { TABLE_SIZE = 100, MAX_PATHS = 20, MAX_PATH_LEN = 256 } |
Public Member Functions | |
void | Init () |
bool | IsRegistered (const UUID &uuid) const |
bool | IsLoaded (const UUID &uuid) const |
bool | Load (const UUID &uuid) |
Element< CC > * | Lookup (const UUID &uuid) const |
Element< CC > * | LookupCompatible (const UUID &uuid) const |
void | AddPath (const char *path) |
bool | RegisterUUID (const UUID &uuid) |
bool | RegisterElement (Element< CC > &e) |
u32 | GetEntryCount () const |
const UUID & | GetEntryUUID (u32 entryIdx) const |
const Element< CC > * | GetEntryElement (u32 entryIdx) const |
The ElementRegistry holds information about all Elements known to a simulation, whether or not they are actually loaded into the running image, and whether or not they (currently) have been 'Needed' into a grid and thereby assigned a type number. It is meant for use only during initialization and is therefore dog slow. It also maintains a search list of directories within which it will search for dynamically loadable elements, on demand.
void MFM::ElementRegistry< CC >::AddPath | ( | const char * | path | ) |
Add a path to the search path, if it is not already there. Fails with OUT_OF_ROOM if no more paths can be added.
|
inline |
Gets the number of currently registered Elements inside this ElementRegistry.
|
inline |
|
inline |
bool MFM::ElementRegistry< CC >::RegisterElement | ( | Element< CC > & | e | ) |
Store an element in the registry keyed by its uuid
bool MFM::ElementRegistry< CC >::RegisterUUID | ( | const UUID & | uuid | ) |
Store a dynamically-loadable element in the registry keyed by its UUID, which is (allegedly) loadable somewhere along the search path