= Factory = [[TracNav(TracNav/TOC_Development)]] == Description == The Factory is a [wiki:singleton] that maps [wiki:Identifier Identifiers] with their name and their network ID. The Factory is used by the !CreateFactory(classname) macro to add new entries. The ClassByName("classname") and ClassByID(network ID) macros use the Factory to retrieve an [wiki:Identifier] with a given classname or a given network ID respectively. See [wiki:CoreIncludes] for more information. The ClassByName and ClassByID macros are an abbreviation of the static function Factory::getIdentifier("name" or ID). The Factory also handles the change of a network ID to avoid conflicts with ambiguous map-entries. == Functions == === Identifiers === * '''getIdentifier('''''name''''')''' and '''getIdentifier('''''network ID''''')''' return the [wiki:Identifier] with the given name or the given network ID respectively. === Iterators === Because the Factory knows all Identifiers with a [wiki:ClassFactory], it provides functions to get the map-iterators to iterate through all stored Identifiers: * '''getFactoryMap()''': returns an iterator to the map. * '''getFactoryMapBegin()''': returns an iterator to the first [wiki:Identifier] in the map. * '''getFactoryMapEnd()''': returns an iterator to the last [wiki:Identifier] in the map. === Class Hierarchy === * '''createClassHierarchy()''': Creates the class hierarchy by creating an instance of all classes in the Identifier map (and destroying them afterwards).