VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtExampleThreadedDriver.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2014 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/DtDriver.h>
13 
15 
18 
19 #include <vlutil/vlRunnable.h>
20 
21 #include <boost/function.hpp>
22 #include <boost/signal.hpp>
23 #include <vlutil/vlThread.h>
24 
25 #include <string>
26 
27 namespace makVrv
28 {
29  class DtAsynchronousAgentManager;
30  class DtAsynchronousEventQueue;
31 }
32 
33 class DtThread;
34 class DtThreadStart;
36 
37 // This driver creates and owns the example driver.
40 {
41 public:
44 
46  virtual ~DtExampleThreadedDriver();
47 
49  virtual const std::string& className() const;
50 
52  virtual void queueDriverFunction(const boost::function<void ()>& function);
53 
55  virtual void queueConnectionFunction(const boost::function<void ()>& function);
56 
59  bool useThreadFlag() const;
60 
64 
66  boost::signal<void (DtExampleSimulationConnection*)> signal_simulationCreated;
67 
69  boost::signal<void (DtExampleSimulationConnection*)> signal_simulationAboutToBeDestroyed;
70 
71 protected:
72 
75  virtual bool onStart();
76 
79  virtual bool onStop();
80 
83  virtual bool onTick();
84 
89  virtual void attachObserverToEntity( const std::string& entityName );
90 
93  virtual void slot_displayEngineAdded( const makVrv::DtDeRecord& igRecord );
94 
97 
99  virtual void run();
100 
103  void startThread();
104 
107  void stopThread();
108 
110  void setSimulationConnectionState( bool state );
111 
113  virtual void connectToDynamicSignals();
114 
117  virtual void disconnectFromDynamicSignals();
118 
120  virtual void slot_togglePinnedLabel(
122 
124  typedef std::vector<boost::function<void ()> > FunctionCallList;
125 
127  virtual void runFunctionQueue(FunctionCallQueue& queue);
128 
129 protected:
130  //Main thread variables.
131  std::string myClassName;
132 
134 
135 
137  DtThreadStartSP myStart;
138  DtThread* myThread;
143 
147 
149 };

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)