VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
timeKeeperCmpt.h
Go to the documentation of this file.
1 /********************************************************************************* Copyright (c) 2004 MAK Technologies, Inc.
2 ** All rights reserved.
3 *******************************************************************************//********************************************************************************* $RCSfile: timeKeeperCmpt.h,v $ $Revision: 1.3 $ $State: Exp $
4 *******************************************************************************/
5 
6 //
7 //class DtTimeKeeperComponent
8 //
9 //This is a component which simply keeps track of the elapsed simulation time
10 //since the component was created. It illustrates the creation and use of
11 //a process state repository to save the simulation time since creation
12 //into a checkpointed scenario file, and read it back in at load time.
13 //
14 
16 
17 class DtTimeKeeperPSR;
18 
19 //String which uniquely identifies this controller
20 const char TimeKeeperComponentType[] = "time-keeper-component";
21 
23 {
24 public:
25  //constructor
28  DtReaderWriterRegistry * parentRegistry = 0);
29 
30  //destructor
31  virtual ~DtTimeKeeperComponent();
32 
33  //copy constructor
35 
36  //assignment operator
38 
39  //Returns the string type for this component.
40  virtual DtString type() const;
41 
42  //Overridden from the base class to call createPSR().
43  virtual bool init();
44 
45  //Create a time-keeper process state repository, or a different
46  //type if it is specified in the OPD.
47  virtual bool createPSR();
48 
49  //Update control values
50  //For this controller, we simply add dT() to our elapsed time
51  //state variable, and print out the value every 10 seconds of
52  //simulation time.
53  virtual void tick();
54 
55  //This is called by the factory
56  static DtSimComponent* creator(const DtString & name, DtVrfObject* owner,
57  DtSimManager * simManager, DtComponentDescriptor* desc,
58  DtReaderWriterRegistry * parentRegistry);
59 
60 protected:
61  //This is the pointer to our process state repository used during
62  //the execution of the simulation.
64 };
65 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)