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 <list>
18 #include <set>
19 #include <string>
20 #include <map>
21 
22 class DtManagedInterface;
23 class DtMessage;
24 class DtMessageFactory;
25 class DtMessageHandler;
26 class DtLinkStrategy;
27 class DtFilePrinter;
28 
31 typedef void (*PluginVerisionFunction)(DtString& version);
32 typedef void (*PluginNameFunction)(DtString& name);
33 typedef DtLinkStrategy* (*StrategyCreator)(DtManagedInterface* gl);
34 
36 typedef void (*ManagedMessageDelegate)(unsigned char* msg, int length);
37 typedef void (*JavaManagedMessageDelegate)(unsigned char* msg, int length, void* data);
38 
40 {
41  DtUnknown = 0,
42  DtDis = 1,
43  DtHLA13 = 2,
44  DtHLA1516 = 3,
46 };
47 
50 {
51  private:
55  virtual ~DtManagedInterface();
56 
57  public:
59  static DtManagedInterface& instance();
60 
62  static bool exists();
63 
65  static void destroy();
66 
68  static bool checkVrlLicense();
69 
71  void initializeManagedInterface(ManagedMessageDelegate del);
73  void initializeManagedInterface(JavaManagedMessageDelegate del, void* data,
74  unsigned char * reusableSendMsgBuffer);
75 
77  void tick(double maxTime);
78 
80  void shutdown();
81 
83  void receiveMessage(unsigned char* msg, int length);
84 
86  void sendMessage(DtMessage* msg);
87 
89  bool handleMessage(DtMessage* msg);
90 
92  virtual DtMessageFactory& messageFactory() const;
93 
96  //{@
98  virtual bool hasResource(const std::string& name) const;
99 
101  virtual void* findResource(const std::string& name ) const;
102 
104  virtual void setResource(const std::string& name, void* asset);
105 
107  virtual bool removeResource(const std::string& name);
109 
111  //{@
112  virtual void addHandler(const std::string& messageType, DtMessageDelegate* handler);
113  virtual void removeHandler(const std::string& messageType, DtMessageDelegate* handler);
115 
117  //{@
118  virtual void addStrategy(DtLinkStrategy* strategy);
119  virtual void removeStrategy(const std::string& name);
120  virtual DtLinkStrategy* findStrategy(const std::string& name);
122 
125  virtual void addStrategyCreator(const std::string& name, StrategyCreator creator);
126 
128  virtual DtLinkStrategy* createStrategy(const std::string& name);
129 
131  virtual double maxDrainInputTime() {return myMaxDrainInputTime;}
132 
134  virtual std::set<DtProtocolType> availableProtocols();
135 
136  public:
137  static std::string theDataPath;
138 
139  protected:
141  virtual void handlePrintMessage(DtMessage* msg);
143  virtual void handleNotifyLevelMessage(DtMessage* msg);
145  virtual void loadLibraries();
147  virtual bool checkLibrariesLoaded(const std::list<std::string>& files, std::set<DtProtocolType>& availableProtocol, bool shouldThrow=false);
148 
150 
152 
154  void* myData;
155  unsigned char* myReusableSendBuffer;
156 
158  std::set<DtProtocolType> myInitializedProtocols;
159 
161 
162  typedef std::map<std::string, void*> ResourceMap;
163  typedef ResourceMap::iterator ResourceIter;
165 
166  typedef std::multimap<std::string, DtMessageDelegate*> HandlerMap;
167  typedef std::pair<std::string, DtMessageDelegate*> HandlerPair;
169 
170  typedef std::map<std::string, DtLinkStrategy*> StrategyMap;
171  typedef std::pair<std::string, DtLinkStrategy*> StrategyPair;
173 
174  typedef std::map<std::string, StrategyCreator> StrategyCreatorMap;
176 
179 
181  std::set<std::string> myFilesLoaded;
182  std::set<std::string> myPluginsLoaded;
183 
185 };

Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)