1 #ifndef COMPONENTFACTORY_H 2 #define COMPONENTFACTORY_H 77 const string& componentNameAndOptionalArgs,
GXemul* gxemul = NULL);
88 static string GetAttribute(
const string& name,
const string&
101 static bool HasAttribute(
const string& name,
const string&
129 string (*getAttributeFunc)(
const string& attributeName));
145 static void RunUnitTests(
int& nSucceeded,
int& nFailures);
149 #endif // COMPONENTFACTORY_H
static refcount_ptr< Component > CreateComponent(const string &componentNameAndOptionalArgs, GXemul *gxemul=NULL)
Creates a component given a short component name.
map< string, string > ComponentCreationSettings
static bool HasAttribute(const string &name, const string &attributeName)
Checks if a component has a specific attribute.
static void RunUnitTests(int &nSucceeded, int &nFailures)
static void UnregisterAllComponentClasses()
Unregisters all manually registered component classes.
static vector< string > GetAllComponentNames(bool onlyTemplates)
Returns a vector of all available component names.
A factory which creates Component objects.
static bool RegisterComponentClass(const char *name, refcount_ptr< Component >(*createFunc)(const ComponentCreateArgs &args), string(*getAttributeFunc)(const string &attributeName))
Adds a new component class to the factory at runtime.
static string GetAttribute(const string &name, const string &attributeName)
Gets a specific attribute value for a component.
static bool GetCreationArgOverrides(ComponentCreationSettings &settings, const ComponentCreateArgs &createArgs)
Get override arguments for component creation.
Base class for unit testable classes.