VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
linearObjectEncoderHLA.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 1992-2026 MAK Technologies, Inc
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #if DtHLA
13 
16 
17 #include <vector>
18 
23 {
24 public:
25 
28 
31 
33  virtual ~DtLinearObjectEncoder();
34 
37 
38 protected:
39 
40  template <typename SegmentRecordType>
41  static bool needSegmentRecords(const DtLinearObjectRepository& stateRep, const DtLinearObjectRepository& asSeenByRemote);
42 
43  template <typename SegmentRecordType, typename SegmentRecordNetType>
44  static void encodeSegmentRecords(const DtLinearObjectRepository& stateRep,
45  RTI::AttributeHandleValuePairSet* attrs, RTI::AttributeHandle attrHandle);
46 };
47 
48 template <typename SegmentRecordType>
50  const DtLinearObjectRepository& stateRep, const DtLinearObjectRepository& asSeenByRemote)
51 {
52  if (stateRep.numSegments() != asSeenByRemote.numSegments())
53  {
54  return true;
55  }
56 
57  for (int count = 0; count < stateRep.numSegments(); ++count)
58  {
59  SegmentRecordType localSegment;
60  stateRep.segment(count, localSegment);
61  SegmentRecordType remoteSegment;
62  asSeenByRemote.segment(count, remoteSegment);
63  if (localSegment != remoteSegment)
64  {
65  return true;
66  }
67  }
68 
69  return false;
70 }
71 
72 template <typename SegmentRecordType, typename SegmentRecordNetType>
74  RTI::AttributeHandleValuePairSet* attrs, RTI::AttributeHandle attrHandle)
75 {
76  int num = stateRep.numSegments();
77  std::vector<SegmentRecordNetType> netVals(num);
78 
79  for (int count = 0; count < num; ++count)
80  {
81  SegmentRecordType localSegment;
82  stateRep.segment(count, localSegment);
83  localSegment.loadNetRecord(netVals[count]);
84  }
85 
86  attrs->add(attrHandle, (char*) netVals.data(), num * sizeof(SegmentRecordNetType));
87 }
88 
89 #endif // DtHLA
Contains the DtLinearObjectRepository class declaration.
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:62
#define DT_DLL_VL
Definition: vlMachineTypes.h:120
static void encodeSegmentRecords(const DtLinearObjectRepository &stateRep, RTI::AttributeHandleValuePairSet *attrs, RTI::AttributeHandle attrHandle)
Definition: linearObjectEncoderHLA.h:73
class DtEnvironmentObjectEncoder:
Definition: environmentObjectEncoder.h:36
static bool needSegmentRecords(const DtLinearObjectRepository &stateRep, const DtLinearObjectRepository &asSeenByRemote)
Definition: linearObjectEncoderHLA.h:49
An instance of DtObjClassDesc is a &quot;class descriptor&quot; for an HLA Object class.
Definition: objClassDesc13.h:41
This file provides a declaration of the class DtEnvironmentObjectEncoder.
virtual bool segment(int index, DtLinearSegmentRecord &record) const
DtLinearObjectEncoder is the base class for HLA environment object state encoders that encode linear ...
Definition: linearObjectEncoderHLA.h:22
virtual int numSegments() const
Instances of DtLinearObjectRepository are used to maintain state information needed by linear object ...
Definition: linearObjectRepository.h:50
DtEnvironmentObjectEncoder & operator=(const DtEnvironmentObjectEncoder &orig)
assignment operator

Document ID: Generated on Mon Sep 28 00:09:32 EDT 2026 from SVN revision 295353
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)