VR-Forces 4.0.4 Class Documentation
include/vrfcgf/cgfDispatcher.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2002 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: cgfDispatcher.h,v $ $Revision: 1.31 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #ifndef DtCgfDispatcher_H_
00010 #define DtCgfDispatcher_H_
00011 
00014 
00017 
00018 #include <vrfExtProtocol/msgTypes.h>
00019 #include "vrfMsgTransport/vrfMsgIf.h"
00020 #include "vrfmsgs/ifLoadScen.h"
00021 #include "vrfmsgs/ifSaveScen.h"
00022 #include "vrfmsgs/ifCloseScen.h"
00023 #include "vrfmsgs/ifControl.h"
00024 #include "vrfcgf/cgf.h"
00025 #include <vlutil/vlFilename.h>
00026 #include "vrfutil/compressedFileTransport.h"
00027 #include <vl/startInter.h>
00028 #include <vl/stopInter.h>
00029 class DtIfControlMsg;
00030 class DtTimer;
00031 
00035 #include "vrfcgf/vrfcgfDefines.h"
00036 class DT_DLL_vrfcgf DtCgfDispatcher
00037 {
00038 public:
00045    DtCgfDispatcher(DtCgf* cgf,
00046       DtVrfMessageInterface* messageIf,
00047       int receivePort = 8000);
00048 
00049    virtual ~DtCgfDispatcher();
00050 
00052    virtual void closeScenario(DtIfCloseScenario* msg);
00053    virtual void loadScenario(DtIfLoadScenario* msg);
00056    virtual void saveScenario(DtIfSaveScenario* msg, 
00057       const DtSimulationAddress& requester);
00058 
00064    virtual void controlScenario(DtIfControl* msgData, 
00065       const DtSimulationAddress& sender);
00066 
00067    virtual void setEnableResourceMonitor(bool b);
00068 
00070    virtual void tick();
00071 
00073    virtual void setTimeToQuit(bool yesNo);
00074    virtual bool timeToQuit() const;
00075 
00077    virtual DtVrfMessageInterface* messageInterface() const;
00078 
00080    virtual DtCgf* cgf() const;
00081 
00083    virtual int port() const;
00084 
00086    virtual const DtFilename& tempDirectory();
00087    virtual void setTempDirectory(const DtFilename& f);
00088 
00092    virtual void cleanupSockets();
00093 
00099    virtual unsigned int simMgmtPduProcessLevel() const;
00100    virtual void setSimMgmtPduProcessLevel(unsigned int level);
00101 
00102    virtual void processCapableTaskAndSetQuery(DtSimMessage* msg);
00103    virtual void processDIGuyAppearAndAniamtionsQuery(DtSimMessage* msg);
00104 
00105 public:
00106    
00109    static void processMessageCb(DtSimMessage* msg, void* usr);
00110 
00112    static void startResumeSimCb(DtStartResumeInteraction* msg, void* usr);
00113 
00115    static void stopFreezeSimCb(DtStopFreezeInteraction* msg, void* usr);
00116 
00118    static void receiveFileCb(const DtFilename& f, void* usr);
00119 
00126    static void runDurationCompleteCallback(DtTimer* timer);
00127 
00128 protected:
00132    virtual bool shouldTryReload(const DtScenario& scenario);
00133 
00135    virtual void pause();
00136 
00138    virtual void run();
00139 
00141    virtual void rewind();
00142 
00145    virtual void step(const DtSimulationAddress& sender);
00146 
00156    virtual void runForDuration(double duration, const DtSimulationAddress& sender);
00157 
00158 protected:
00159 
00160    int myPort;
00161    bool myTimeToQuit;
00162    DtCgf* myCgf;
00163    DtVrfMessageInterface* myMessageIf;
00164    DtFilename myDir;
00165    DtCompressedFileTransporter myTransporter;
00166 
00171    DtIfLoadScenario* myPendingLoadScenario;
00172    unsigned int mySimMgmtPduProcessLevel;
00173 };
00174 
00175 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)