VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
linearObjectTransactionDecoder.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 
32 
35 
36 protected:
37 
38  template <typename SegmentRecordType, typename SegmentRecordNetType,
39  typename CountMutator, typename SegmentMutator>
40  static void decodeSegmentRecords(DtLinearObjectTransaction* inter,
41  const RTI::ParameterHandleValuePairSet& params, int index,
42  CountMutator countMutator, SegmentMutator segmentMutator);
43 };
44 
45 template <typename SegmentRecordType, typename SegmentRecordNetType,
46  typename CountMutator, typename SegmentMutator>
50  int index,
51  CountMutator countMutator,
52  SegmentMutator segmentMutator)
53 {
54  RTI::ULong length = 0;
55  char* buffer = parameterData(params, index, length);
56 
57  if (length == 0)
58  {
59  (inter->*countMutator)(0);
60  return;
61  }
62 
63  if (length % sizeof(SegmentRecordNetType) != 0)
64  {
65  DtWarn("Can't decode SegmentRecords : Size %d not a multiple of the size of a parameter (%d).\n",
66  length, sizeof(SegmentRecordNetType));
67 
68  (inter->*countMutator)(0);
69  return;
70  }
71 
72  int numSegs = length / sizeof(SegmentRecordNetType);
73  (inter->*countMutator)(numSegs);
74 
75  for (int segCount = 0; segCount < numSegs; ++segCount)
76  {
77  SegmentRecordNetType* netSegPtr = (SegmentRecordNetType*)buffer;
78  SegmentRecordType rec;
79 
80  rec = *netSegPtr;
81  (inter->*segmentMutator)(segCount, rec);
82  buffer += sizeof(SegmentRecordNetType);
83  }
84 }
85 
86 #endif // DtHLA
DtEnvironmentObjectTransactionDecoder & operator=(const DtEnvironmentObjectTransactionDecoder &orig)
assignment operator
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:62
class DtEnvironmentObjectTransactionDecoder:
Definition: environmentObjectTransactionDecoder.h:41
#define DT_DLL_VL
Definition: vlMachineTypes.h:120
Instances of DtInterClassDesc are used to represent HLA Object and Interaction classes.
Definition: interClassDesc.h:33
This file provides a declaration of the class DtLinearObjectTransaction.
static char * parameterData(const RTI::ParameterHandleValuePairSet &pvList, int index, RTI::ULong &length)
Returns a pointer to a buffer containing the parameter data.
Definition: interactionDecoder.h:165
class DtLinearObjectTransaction
Definition: linearObjectTransaction.h:47
DtOutputStream DtWarn
These DtOutputStream instances are used for all print messaging in VR-Link.
static void decodeSegmentRecords(DtLinearObjectTransaction *inter, const RTI::ParameterHandleValuePairSet &params, int index, CountMutator countMutator, SegmentMutator segmentMutator)
Definition: linearObjectTransactionDecoder.h:47
Used to provide backwards compatibility for VR-Link Encoders and Decoders who use either AttributeHan...
Definition: rtiCompatibility.h:237
unsigned long ULong
These typedefs are provided for source compatibility.
Definition: rtiCompatibility.h:274
This file provides a declaration of the class DtEnvironmentObjectTransactionDecoder.
DtLinearObjectTransactionDecoder is the base class for HLA environment object transaction decoders th...
Definition: linearObjectTransactionDecoder.h:20

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)