VR-Link API Documentation for HLA 1.3
 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-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
7 #if DtHLA
8 
9 #include <stdio.h>
11 
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 
59 {
60  return new MyEntityStateRep();
61 }
62 
64 {
65  if (copy)
66  {
67  return new MyEntityStateRep(*this);
68  }
69  else
70  {
71  return new MyEntityStateRep();
72  }
73 }
74 
75 #endif
76 
Because this example adds a concept that did not already exist in VR-Link&#39;s DtEntityStateRepository c...
Definition: myEsr.h:16
virtual void printData() const
Virtual function override: print the state rep&#39;s data.
Definition: myEsr.h:52
virtual DtStateRepository * clone(bool copy=false) const
Copy shallow (false) or deep (true).
Definition: myEsr.h:63
Instances of DtEntityStateRepository are used to maintain attributes and state of entity objects in a...
Definition: entityStateRepository.h:42
float myMass
Definition: myEsr.h:38
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
Contains the DtEntityStateRepository class declaration.
static DtEntityStateRepository * create()
Create a MyEntityStateRep. Caller is responsible for deletion.
Definition: myEsr.h:58
virtual void setMass(float mass)
Set the mass.
Definition: myEsr.h:42
virtual void printData() const
Print the state data to the DtInfo stream.
virtual float mass() const
Return the mass.
Definition: myEsr.h:47

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)