static MyTarget proto(args);adds the prototype instance to the known list with a call to
static KnownTarget entry(proto,"MyTarget");
static void addEntry (Target &target, const char* name, int onHeap);This function actually adds the Target to the list. If
onHeapis true, the target will be destroyed when the entry is removed or replaced from the list. There is only one list of Targets.
static const Target* find (const char* name);The find method returns a pointer the appropriate target. A null pointer is returned if no match is found.
static Target* clone (const char* name);The
clonemethod takes a string, finds the appropriate target on the known target list, and returns a clone of that target (the
cloneTargetmethod is called on the target). This method, as a rule, generates a duplicate of the target. An error message is generated (with
Error::abortRun)and a null pointer is returned if there is no match.
static int getList (const Block& b, const char** names, int nMax);This function returns a list of names of targets that are compatible with the Block
b.The return value gives the number of matches. The
namesarray can hold
nMaxstrings; if there are more, only the first
static int getList (const char* dom, const char** names, int nMax);This function is the same as above, except that it returns names of targets that are compatible with stars of a particular domain.
static int isDynamic (const char* type);Return true if there is a target on the known list named
typethat is dynamically linked; otherwise return false.
static const char* defaultName (const char* dom = 0);Return the default target name for a domain (default: current domain). There is an iterator associated with KnownTarget, called KnownTargetIter. Since there is only one known target list, it is unusual for an iterator in that it takes no argument for its constructor. Its
nextfunction returns the type
const Target *; it steps through the targets on the known list.