VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
managedInterface.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
6 #pragma once
7 
11 
14 
15 #include <vlutil/vlString.h>
16 
17 #include <string>
18 #include <map>
19 
20 class DtManagedInterface;
21 class DtMessage;
22 class DtMessageFactory;
23 class DtMessageHandler;
24 class DtLinkStrategy;
25 class DtFilePrinter;
26 
29 typedef void (*PluginVerisionFunction)(DtString& version);
30 typedef DtLinkStrategy* (*StrategyCreator)(DtManagedInterface* gl);
31 
33 typedef void (*ManagedMessageDelegate)(unsigned char* msg, int length);
34 
37 {
38  private:
42  virtual ~DtManagedInterface();
43 
44  public:
46  static DtManagedInterface& instance();
47 
49  static bool exists();
50 
52  static void destroy();
53 
55  void initializeManagedInterface(ManagedMessageDelegate del);
56 
58  void tick(double maxTime);
59 
61  void shutdown();
62 
64  void receiveMessage(unsigned char* msg, int length);
65 
67  void sendMessage(DtMessage* msg);
68 
70  bool handleMessage(DtMessage* msg);
71 
73  virtual DtMessageFactory& messageFactory() const;
74 
77  //{@
79  virtual bool hasResource(std::string name) const;
80 
82  virtual void* findResource(std::string name ) const;
83 
85  virtual void setResource(std::string name, void* asset);
86 
88  virtual bool removeResource(std::string name);
90 
92  //{@
93  virtual void addHandler(std::string messageType, DtMessageDelegate* handler);
94  virtual void removeHandler(std::string messageType, DtMessageDelegate* handler);
96 
98  //{@
99  virtual void addStrategy(DtLinkStrategy* strategy);
100  virtual void removeStrategy(std::string name);
101  virtual DtLinkStrategy* findStrategy(std::string name);
103 
106  virtual void addStrategyCreator(std::string name, StrategyCreator creator);
107 
109  virtual DtLinkStrategy* createStrategy(std::string name);
110 
112  virtual double maxDrainInputTime() {return myMaxDrainInputTime;}
113 
114  public:
115  static std::string theDataPath;
116 
117  protected:
119  virtual void handlePrintMessage(DtMessage* msg);
121  virtual void handleNotifyLevelMessage(DtMessage* msg);
123  virtual void loadLibraries();
124 
126 
128 
130 
132 
133  typedef std::map<std::string, void*> ResourceMap;
134  typedef ResourceMap::iterator ResourceIter;
136 
137  typedef std::multimap<std::string, DtMessageDelegate*> HandlerMap;
138  typedef std::pair<std::string, DtMessageDelegate*> HandlerPair;
140 
141  typedef std::map<std::string, DtLinkStrategy*> StrategyMap;
142  typedef std::pair<std::string, DtLinkStrategy*> StrategyPair;
144 
145  typedef std::map<std::string, StrategyCreator> StrategyCreatorMap;
147 
150 
152 
154 };

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)