VR-Forces 4.1 Class Documentation
cgfDispatcher.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2002 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: cgfDispatcher.h,v $ $Revision: 1.31 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef DtCgfDispatcher_H_
10 #define DtCgfDispatcher_H_
11 
14 
17 
20 #include "vrfmsgs/ifLoadScen.h"
21 #include "vrfmsgs/ifSaveScen.h"
22 #include "vrfmsgs/ifCloseScen.h"
23 #include "vrfmsgs/ifControl.h"
24 #include "vrfcgf/cgf.h"
25 #include <vlutil/vlFilename.h>
27 #include <vl/startInter.h>
28 #include <vl/stopInter.h>
29 class DtIfControlMsg;
30 class DtTimer;
33 
37 #include "vrfcgf/vrfcgfDefines.h"
39 {
40 public:
48  DtVrfMessageInterface* messageIf,
49  int receivePort = 8000);
50 
51  virtual ~DtCgfDispatcher();
52 
54  virtual void closeScenario(DtIfCloseScenario* msg);
55  virtual void loadScenario(DtIfLoadScenario* msg);
58  virtual void saveScenario(DtIfSaveScenario* msg,
59  const DtSimulationAddress& requester);
60 
62  virtual void importScenarioDescriptionFile(DtIfImportScenarioDescriptionFile*);
63 
65  virtual void exportScenarioDescriptionFile(DtIfExportScenarioDescriptionFile*);
66 
72  virtual void controlScenario(DtIfControl* msgData,
73  const DtSimulationAddress& sender);
74 
75  virtual void setEnableResourceMonitor(bool b);
76 
78  virtual void tick();
79 
81  virtual void setTimeToQuit(bool yesNo);
82  virtual bool timeToQuit() const;
83 
85  virtual DtVrfMessageInterface* messageInterface() const;
86 
88  virtual DtCgf* cgf() const;
89 
91  virtual int port() const;
92 
94  virtual const DtFilename& tempDirectory();
95  virtual void setTempDirectory(const DtFilename& f);
96 
100  virtual void cleanupSockets();
101 
107  virtual unsigned int simMgmtPduProcessLevel() const;
108  virtual void setSimMgmtPduProcessLevel(unsigned int level);
109 
110  virtual void processCapableTaskAndSetQuery(DtSimMessage* msg);
111  virtual void processDIGuyAppearAndAniamtionsQuery(DtSimMessage* msg);
112 
113 public:
114 
117  static void processMessageCb(DtSimMessage* msg, void* usr);
118 
120  static void startResumeSimCb(DtStartResumeInteraction* msg, void* usr);
121 
123  static void stopFreezeSimCb(DtStopFreezeInteraction* msg, void* usr);
124 
126  static void receiveFileCb(const DtFilename& f, void* usr);
127 
134  static void runDurationCompleteCallback(DtTimer* timer);
135 
136 protected:
140  virtual bool shouldTryReload(const DtScenario& scenario);
141 
145  virtual bool shouldTryReload(const DtIfImportScenarioDescriptionFile*);
146 
148  virtual void pause();
149 
151  virtual void run();
152 
154  virtual void rewind();
155 
158  virtual void step(const DtSimulationAddress& sender);
159 
169  virtual void runForDuration(double duration, const DtSimulationAddress& sender);
170 
171 protected:
172 
173  int myPort;
177  DtFilename myDir;
179 
186 
188 };
189 
190 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)