VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 initializeNumberOfStates(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 };
Definition: scriptResourceManager.h:41
std::map< DtString, DtScriptResourceManager * > DtScriptResourceManagerMap
Definition: scriptResourceManager.h:39
std::map< DtString, DtScriptResourceManagerCreatorFunc > myCreators
Definition: scriptResourceManager.h:69
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
std::vector< std::string > myScriptPaths
Definition: scriptResourceManager.h:31
virtual void setScriptPaths(const std::vector< std::string > &scriptPaths)
Definition: scriptResourceManager.h:23
Manages resources shared by scripts.
Definition: scriptResourceManager.h:15
static DtScriptResourceManagerFactory * theFactoryInstance
Definition: scriptResourceManager.h:70
DtScriptResourceManager *(* DtScriptResourceManagerCreatorFunc)()
Factory.
Definition: scriptResourceManager.h:38
virtual const std::vector< std::string > & scriptPaths() const
Definition: scriptResourceManager.h:24

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)