30 #ifndef _CEGUIWindowFactoryManager_h_
31 #define _CEGUIWindowFactoryManager_h_
33 #include "CEGUIBase.h"
34 #include "CEGUIString.h"
35 #include "CEGUISingleton.h"
36 #include "CEGUILogger.h"
37 #include "CEGUIIteratorBase.h"
38 #include "CEGUIWindowFactory.h"
43 # pragma warning(push)
44 # pragma warning(disable : 4275)
45 # pragma warning(disable : 4251)
104 const String& getActiveTarget(
void)
const;
113 uint getStackedTargetCount(
void)
const;
118 typedef std::vector<String> TargetTypeStack;
120 TargetTypeStack d_targetStack;
140 Logger::getSingleton().logEvent(
"CEGUI::WindowFactoryManager singleton destroyed");
175 template <
typename T>
176 static void addFactory();
193 void removeFactory(
const String& name);
220 void removeAllFactories(
void);
252 bool isFactoryPresent(
const String& name)
const;
280 void addWindowTypeAlias(
const String& aliasName,
const String& targetType);
300 void removeWindowTypeAlias(
const String& aliasName,
const String& targetType);
333 void addFalagardWindowMapping(
const String& newType,
346 void removeFalagardWindowMapping(
const String& type);
359 bool isFalagardMappedType(
const String& type)
const;
373 const String& getMappedLookForType(
const String& type)
const;
387 const String& getMappedRendererForType(
const String& type)
const;
407 String getDereferencedAliasType(
const String& type)
const;
421 const FalagardWindowMapping& getFalagardMappingForType(
const String& type)
const;
427 typedef std::map<String, WindowFactory*, String::FastLessCompare> WindowFactoryRegistry;
428 typedef std::map<String, AliasTargetStack, String::FastLessCompare> TypeAliasRegistry;
429 typedef std::map<String, FalagardWindowMapping, String::FastLessCompare> FalagardMapRegistry;
431 typedef std::vector<WindowFactory*> OwnedWindowFactoryList;
433 WindowFactoryRegistry d_factoryRegistry;
434 TypeAliasRegistry d_aliasRegistry;
435 FalagardMapRegistry d_falagardRegistry;
437 static OwnedWindowFactoryList d_ownedFactories;
451 WindowFactoryIterator getIterator(
void)
const;
458 TypeAliasIterator getAliasIterator(
void)
const;
465 FalagardMappingIterator getFalagardMappingIterator()
const;
469 template <
typename T>
473 WindowFactory* factory =
new T;
476 if (WindowFactoryManager::getSingletonPtr())
478 Logger::getSingleton().logEvent(
"Created WindowFactory for '" +
479 factory->getTypeName() +
484 WindowFactoryManager::getSingleton().addFactory(factory);
486 CEGUI_CATCH (Exception&)
488 Logger::getSingleton().logEvent(
"Deleted WindowFactory for '" +
489 factory->getTypeName() +
497 d_ownedFactories.push_back(factory);
503 #if defined(_MSC_VER)
504 # pragma warning(pop)
507 #endif // end of guard _CEGUIWindowFactoryManager_h_