VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
linearObjectDecoderHLA.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 
21 {
22 public:
23 
26 
29 
31  virtual ~DtLinearObjectDecoder();
32 
35 
36 protected:
37 
38  template <typename SegmentRecordType, typename SegmentRecordNetType>
39  static void decodeSegmentRecords(DtLinearObjectRepository* stateRep,
40  const RTI::AttributeHandleValuePairSet& attrs, int pairSetIndex);
41 };
42 
43 template <typename SegmentRecordType, typename SegmentRecordNetType>
45  const RTI::AttributeHandleValuePairSet& attrs, int pairSetIndex)
46 {
47  RTI::ULong length = 0;
48  char* buffer = attributeData(attrs, pairSetIndex, length);
49 
50  if (length == 0)
51  {
52  stateRep->setNumSegments(0);
53  return;
54  }
55 
56  if (length % sizeof(SegmentRecordNetType) != 0)
57  {
58  DtWarn("Can't decode SegmentRecords : Size %d not a multiple of the size of a parameter (%d).\n",
59  length, sizeof(SegmentRecordNetType));
60 
61  stateRep->setNumSegments(0);
62  return;
63  }
64 
65  int numSegs = length / sizeof(SegmentRecordNetType);
66  stateRep->setNumSegments(numSegs);
67 
68  for (int segCount = 0; segCount < numSegs; ++segCount)
69  {
70  SegmentRecordNetType* netSegPtr = (SegmentRecordNetType*) buffer;
71  SegmentRecordType rec;
72 
73  rec = *netSegPtr;
74  stateRep->setSegment(segCount, rec);
75  buffer += sizeof(SegmentRecordNetType);
76  }
77 }
78 
79 #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
class DtEnvironmentObjectDecoder:
Definition: environmentObjectDecoder.h:31
DtLinearObjectDecoder is the base class for HLA environment object state decoders that decode linear ...
Definition: linearObjectDecoderHLA.h:20
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 DtEnvironmentObjectDecoder.
DtOutputStream DtWarn
These DtOutputStream instances are used for all print messaging in VR-Link.
static void decodeSegmentRecords(DtLinearObjectRepository *stateRep, const RTI::AttributeHandleValuePairSet &attrs, int pairSetIndex)
Definition: linearObjectDecoderHLA.h:44
DtEnvironmentObjectDecoder & operator=(const DtEnvironmentObjectDecoder &orig)
assignment operator
static char * attributeData(const RTI::AttributeHandleValuePairSet &attrs, int index, RTI::ULong &length)
Returns a pointer to the attribute data.
Definition: hlaStateDecoder.h:190
virtual bool setSegment(int index, const DtLinearSegmentRecord &record)
Instances of DtLinearObjectRepository are used to maintain state information needed by linear object ...
Definition: linearObjectRepository.h:50
virtual bool setNumSegments(int newNumber)

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)