VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spaceSR.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: spaceSR.h,v $ $Revision: 1.12 $ $State: Exp $
7 *******************************************************************************/
8 
9 
10 //
11 //File: spaceSR.h
12 //
13 //Class: DtSpaceEntityStateRepository
14 //
15 //Description: This repository holds all information that is common to all the
16 //forms of space entities within the system. It contains a pointer
17 //to the space entity parameters, and provides accessors and mutators
18 //for all parameter values. In this example, we add a single new parameter,
19 //myCurrentHullTemperature, representing the current hull temperature of this
20 //(e.g. such as during reentry). Any future controller and actuator components
21 //we build to simulate the entity's behavior can view or set this new parameter as necessary.
22 //
23 
24 
25 #ifndef DtSpaceEntityStateRepository_H_
26 #define DtSpaceEntityStateRepository_H_
27 
28 
29 #include <vlutil/vlMachineTypes.h>
30 #include "vrfobjcore/vrfObject.h"
34 
36 class DtVector;
37 
39 {
40 
41 public:
42 
43  //Constructor with parameters to set up read/writability correctly.
45  const DtObjectType& objectType, DtVrfObjectParameters* parameters,
46  const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
47 
48  //copy constructor
50 
51  //assignment operator
53  const DtSpaceEntityStateRepository& orig);
54 
55  //destructor
57 
58  virtual bool init();
59 
60  //Returns a unique string identifying the type of component,
61  //DtSpaceVehicleSRType (defined in spacetypes.h). Used a key in
62  //the state repository factory.
63  virtual DtString type() const;
64 
65  //Override to create an instance DtSpaceEntityParameters and
66  //set it in myParameters data member.
67  virtual bool createParameters();
68 
69  //Report hull temperature every 10 seconds
70  virtual void tick();
71 
72  //Override to initialize space entity specific parameters from
73  //our parameters object.
74  virtual void initializeFromParameters();
75 
76  //Implemented for convenience. Since we overrode createParameters()
77  //to create a DtSpaceEntityParameters object (a derived kind of
78  //DtSimObjectParameters), we provide an accessor casting it to the
79  //dervied type.
80  virtual const DtSpaceEntityParameters * spaceEntityParameters() const;
81 
82  //Accessor/mutator for our new parameter, myCurrentHullTemperature.
83  //Set/get hull temperature this entity can sustain (degrees C).
84  virtual void setCurrentHullTemperature(DtReal temp);
85  virtual DtReal currentHullTemperature() const;
86 
87  //Returns a newly created instance of this class. To be registered
88  //with the state repository factory.
89  static DtVrfObjectStateRepository * creator(const DtString& name,
90  DtVrfObject* vrfObject,const DtObjectType& objectType,
91  DtVrfObjectParameters* parameters, DtReaderWriterRegistry* parentRegistry);
92 
93  //Returns a the pointer the repository, if the repository passed
94  //in is of type DtSpaceEntityStateRepository, 0 if not. Implmementation
95  //is optional - may be useful for safe type checking.
97  const DtVrfObjectStateRepository* repository);
98 
99 protected:
100 
101  //Current hull temperature (in degrees Celsius).
103 
106 };
107 
108 #endif

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)