KnownState (State &state, const char* name);This constructor adds an entry to the state type list. For example,
static IntState proto;permits IntStates to be produced by cloning. The
static KnownState entry(proto,"INT");
typeargument must be in upper case, because of the way
findworks (see below). The second type of constructor takes three arguments:
KnownState (State &state, const char* name, const char* value);This constructor permits names to be added to the global state symbol list, for use in state expressions. For example, we have
static FloatState pi;
static const State* find (const char* type);The
findmethod returns a pointer the appropriate prototype state in the state type list. The argument is always changed to upper case. A null pointer is returned if there is no match.
static const State* lookup (const char* name);The lookup method returns a pointer to the appropriate state in the global state list, or null if there is no match.
static State* clone (const char* type);The clone method takes a string, finds the appropriate state using
find,and returns a clone of that block. A null pointer is returned if there is no match, and
Error::erroris also called.
static StringList nameList();Return the names of all the known state types, separated by newlines.
static int nKnown();Return the number of known states.