VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
myEsr.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
7 #if DtHLA
8 
9 #include <stdio.h>
11 
16 class MyEntityStateRep : public DtEntityStateRepository
17 {
18 public:
19 
21  virtual void setMass(float mass);
23  virtual float mass() const;
24 
26  virtual void printData() const;
27 
28 public:
29 
32 
34  virtual DtStateRepository* clone(bool copy = false) const;
35 
36 protected:
37 
38  float myMass;
39 };
40 
41 
42 inline void MyEntityStateRep::setMass(float temp)
43 {
44  myMass = temp;
45 }
46 
47 inline float MyEntityStateRep::mass() const
48 {
49  return myMass;
50 }
51 
52 inline void MyEntityStateRep::printData() const
53 {
55  printf("Mass: %lf\n", mass());
56 }
57 
58 inline DtEntityStateRepository* MyEntityStateRep::create()
59 {
60  return new MyEntityStateRep();
61 }
62 
63 inline DtStateRepository* MyEntityStateRep::clone(bool copy) const
64 {
65  if (copy)
66  {
67  return new MyEntityStateRep(*this);
68  }
69  else
70  {
71  return new MyEntityStateRep();
72  }
73 }
74 
75 #endif
76 
static DtEntityStateRepository * create()
Static create method.
Instances of DtEntityStateRepository are used to maintain attributes and state of entity objects in a...
Definition: entityStateRepository.h:36
virtual DtStateRepository * clone(bool copy=false) const
Return a copy/empty object of the same type as this.
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
Contains the DtEntityStateRepository class declaration.
virtual void printData() const
Print the state data to the DtInfo stream.

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)