MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Public Types | Public Member Functions
MFM::ElementRegistry< CC > Class Template Reference

#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 UUIDGetEntryUUID (u32 entryIdx) const
 
const Element< CC > * GetEntryElement (u32 entryIdx) const
 

Detailed Description

template<class CC>
class MFM::ElementRegistry< CC >

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.

Member Function Documentation

template<class CC >
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.

template<class CC>
u32 MFM::ElementRegistry< CC >::GetEntryCount ( ) const
inline

Gets the number of currently registered Elements inside this ElementRegistry.

template<class CC>
const Element<CC>* MFM::ElementRegistry< CC >::GetEntryElement ( u32  entryIdx) const
inline

Gets a pointer to the specific Element which was loaded in a particular index.

Parameters
entryIdxThe index at which this Element was loaded. For instance, the Element at index 0 was loaded first.
Returns
The Element of the element loaded at this partuclar index.
template<class CC>
const UUID& MFM::ElementRegistry< CC >::GetEntryUUID ( u32  entryIdx) const
inline

Gets the UUID of the Element which was loaded in a particular index.

Parameters
entryIdxThe index at which this UUID was loaded. For instance, the UUID at index 0 was loaded first.
Returns
The UUID of the element loaded at this partuclar index.
template<class CC >
bool MFM::ElementRegistry< CC >::RegisterElement ( Element< CC > &  e)

Store an element in the registry keyed by its uuid

template<class CC >
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


The documentation for this class was generated from the following files: