Atoms Crowd  4.1.0
AnimLoaderFactory.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <AtomsCore/Globals.h>
11 #include <Atoms/Loaders/BaseAnimLoader.h>
12 #include <map>
13 #include <vector>
14 
15 namespace Atoms
16 {
18 
20  class ATOMS_EXPORT AnimLoaderFactory
21  {
22  public:
23 
24  typedef AtomsPtr<BaseAnimLoader> (*creatorFn)();
25 
28 
30 
34  AtomsPtr<BaseAnimLoader> createAnimLoader(const std::string& typeName);
35 
37 
41  void registerAnimLoader(const std::string& name, creatorFn funct);
42 
44 
47  void deregisterAnimLoader(const std::string& name);
48 
50 
53  std::vector<std::string> getRegisteredAnimLoaders();
54 
56 
60  bool isRegistered(const std::string& name);
61 
62  private:
63 
66 
69 
72 
74  AnimLoaderFactory& operator=(const AnimLoaderFactory&);
75 
76  typedef std::map<std::string, creatorFn> FactoryMap;
77 
79 
82  FactoryMap m_factoryMap;
83  };
84 }
Atoms::AnimLoaderFactory
AnimLoader factory.
Definition: AnimLoaderFactory.h:21
Atoms::AnimLoaderFactory::createAnimLoader
AtomsPtr< BaseAnimLoader > createAnimLoader(const std::string &typeName)
Creates an anim loader.
Atoms::AnimLoaderFactory::instance
static AnimLoaderFactory & instance()
Singleton access.
Atoms
Atoms namespace.
Definition: Agent.h:28
Atoms::AnimLoaderFactory::registerAnimLoader
void registerAnimLoader(const std::string &name, creatorFn funct)
Registers a new anim loader type in the factory.
Atoms::AnimLoaderFactory::getRegisteredAnimLoaders
std::vector< std::string > getRegisteredAnimLoaders()
Gets all registered anim loader.
Atoms::AnimLoaderFactory::deregisterAnimLoader
void deregisterAnimLoader(const std::string &name)
Deregisters an anim loader type from the factory.
Atoms::AnimLoaderFactory::isRegistered
bool isRegistered(const std::string &name)
Checks if an anim loader type with the given name is registered.