VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simObjectReferenceTemplate.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrfutil/uuid.h>
13 #include <vlpi/entityType.h>
14 
15 namespace makVrf
16 {
17  class DtStateDataWrapper;
18 
27  template <typename T_BaseClass>
29  {
30  public:
33 
44 
47 
52 
55  const T_BaseClass* operator -> () const;
58  const T_BaseClass* operator * () const;
61  operator const T_BaseClass* () const { return dynamic_cast<const T_BaseClass*>(mySimObject.get()); };
62 
65  const DtUUID& uuid() const;
66 
69  DtEntityType entityType() const;
70 
72  void reset();
73 
77 
81  bool operator < ( const DtSimObjectReferenceTemplate& rhs ) const;
85  bool operator > ( const DtSimObjectReferenceTemplate& rhs ) const { return !operator==(rhs) && !operator<( rhs ); };
89  bool operator == ( const DtSimObjectReferenceTemplate& rhs ) const;
90 
94  bool operator < ( const DtUUID& rhs ) const;
98  bool operator > ( const DtUUID& rhs ) const { return !operator==(rhs) && !operator<( rhs ); };
102  bool operator == ( const DtUUID& rhs ) const;
103 
107  bool operator == (const T_BaseClass* rhs) const;
108 
110  operator DtUUID() const;
113  DtString objectName() const;
114 
117  bool isValid() const;
120  bool isDeleted() const;
121 
122  protected:
124  std::shared_ptr<const DtStateDataWrapper> mySimObject;
125  };
126 }
127 
128 #include "simObjectReferenceTemplate.inl"
UUID is a unique ID wrapper class.
Definition: uuid.h:59
const T_BaseClass * operator->() const
Member-access operator; asserts if the reference is not valid.
std::shared_ptr< const DtStateDataWrapper > mySimObject
Shared pointer to the underlying state-data object; null for an invalid reference.
Definition: simObjectReferenceTemplate.h:124
bool operator>(const DtSimObjectReferenceTemplate &rhs) const
Greater-than comparison by UUID.
Definition: simObjectReferenceTemplate.h:85
Contains the DtUUID class declaration.
bool operator==(const DtSimObjectReferenceTemplate &rhs) const
Equality comparison by UUID.
bool operator<(const DtSimObjectReferenceTemplate &rhs) const
Less-than comparison by UUID.
const T_BaseClass * operator*() const
Dereference operator; asserts if the reference is not valid.
static DtSimObjectReferenceTemplate nullReference()
Returns a null (invalid) reference suitable for default initialisation.
DtSimObjectReferenceTemplate()
Default-constructs a null (invalid) reference.
Definition: simObjectReferenceTemplate.h:32
virtual ~DtSimObjectReferenceTemplate()
Destructor.
bool isDeleted() const
Returns true if the underlying object has been deleted from the simulation.
const DtUUID & uuid() const
Returns the UUID of the referenced object, or a null UUID if invalid.
The DtSimObjectReferenceTemplate is a shared pointer that can be used amongst many object for access ...
Definition: simObjectReferenceTemplate.h:28
DtString objectName() const
Returns the human-readable name of the referenced object.
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: stateDataWrapper.h:49
DtEntityType entityType() const
Returns the DtEntityType of the referenced object, or a null DtEntityType if invalid.
void reset()
Resets this reference to a null (invalid) state.
bool isValid() const
Do not call the -&gt;checkValidity() method to echk object validity as that could cause a crash if the o...
DtSimObjectReferenceTemplate & operator=(const DtStateDataWrapper *rhs)
Assigns a new raw state-data pointer to this reference.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)