VR-Forces 4.0.4 Class Documentation
examples/tutorialDistributedSimulation2B/DistributedSimulationDriver2B.h
Go to the documentation of this file.
00001 /****************************************************************************** 
00002 ** Copyright (c) 2011 MAK Technologies, Inc. 
00003 ** All rights reserved. 
00004 ******************************************************************************/ 
00005 
00008 
00009 #pragma once
00010 
00011 #include <vrvCore/DtDriver.h>
00012 #include <vlutil/vlRunnable.h>
00013 
00014 class DtExerciseConn;
00015 class DtThread;
00016 class DtThreadStart;
00017 
00018 namespace makVrv
00019 {
00020 namespace tutorialDistributedSimulation2B
00021 {
00022 
00023 class DistributedSimulationDriver : public DtDriver, 
00024    protected DtRunnable
00025 {
00026 public:
00027 
00029    DistributedSimulationDriver(DtAgentManager& agentManager, const std::string& instanceName);
00030 
00032    virtual ~DistributedSimulationDriver();
00033 
00035    virtual const std::string& className() const;
00036 
00038    DtExerciseConn* connection()
00039    {
00040       return myConnection;
00041    }
00042 
00043 protected:
00044 
00047    virtual bool onStart();
00048 
00050    virtual bool onStop();
00051 
00053    virtual bool onTick();
00054 
00056    virtual void run();
00057 
00060    void startThread();
00061 
00064    void stopThread();
00065 
00066 protected:
00067 
00068    DtExerciseConn* myConnection;
00069    bool myConnectionState;
00070 
00072    //Cross thread variables.  They are used between the two threads for
00073    //communication.
00074    DtThreadStart* myStart;
00075    DtThread* myThread;
00077 };
00078 
00079 }
00080 }

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)