VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
scriptResourceManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
8 #include <vlutil/vlString.h>
9 #include <vlutil/vlFilename.h>
10 #include <map>
11 #include <vector>
12 #include <string>
13 
16 {
17 public:
19  virtual ~DtScriptResourceManager();
20 
21  virtual void initializeForScenario(unsigned numObjects) = 0;
22 
23  virtual void setScriptPaths(const std::vector<std::string>& scriptPaths) { myScriptPaths = scriptPaths; }
24  virtual const std::vector<std::string>& scriptPaths() const { return myScriptPaths; }
25 
26 protected:
28  DtScriptResourceManager& operator=(const DtScriptResourceManager& other);
29 
30 
31  std::vector<std::string> myScriptPaths;
32 
33 };
34 
35 
37 
38 typedef DtScriptResourceManager* (*DtScriptResourceManagerCreatorFunc)();
39 typedef std::map<DtString, DtScriptResourceManager*> DtScriptResourceManagerMap;
40 
42 {
43 protected:
47 
48 public:
50 
52  static DtScriptResourceManagerFactory* instance();
53 
55  virtual DtScriptResourceManager* createInstance(const DtString& type);
56 
58  virtual void createInstancesOfEachType(DtScriptResourceManagerMap& managers);
59 
62  virtual void registerCreator(const DtString& type, DtScriptResourceManagerCreatorFunc func);
63 
65  static void setFactory(DtScriptResourceManagerFactory* factory);
66  static DtScriptResourceManagerFactory* create();
67 
68 protected:
69  std::map<DtString, DtScriptResourceManagerCreatorFunc> myCreators;
71 };

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)