VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extendedAttributeEncoderHLA.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #if DtHLA
12 
13 #include <vlutil/vlString.h>
14 #include <vl/fom.h>
15 #include <vl/objClassDesc.h>
16 #include <vl/hlaStateEncoder.h>
18 
19 namespace makVrfVrlinkExtToolkit
20 {
21  template <typename StateRepType>
23  {
24  public:
25 
29  static void encodeExtendedAttribute(const StateRepType& rep,
30  RTI::AttributeHandleValuePairSet* attrs,
31  RTI::AttributeHandle attrHandle)
32  {
33  const StateRepType* extSR = dynamic_cast<const StateRepType*>(&rep);
34 
35  if (!extSR)
36  {
37  return;
38  }
39 
40  unsigned srLength = 0;
41  const char* srValue = extSR->getAttributeByHandle(attrHandle, srLength);
42  attrs->add(attrHandle, (char*)srValue, srLength);
43  }
44 
47  static bool needExtendedAttribute(const DtStateRepository& stateRep,
48  const DtStateRepository& asSeenByRemote,
49  RTI::AttributeHandle attrHandle)
50  {
51  const StateRepType* extSR = dynamic_cast<const StateRepType*>(&stateRep);
52  const StateRepType* extASBR = dynamic_cast<const StateRepType*>(&asSeenByRemote);
53 
54  if (!extSR || !extASBR)
55  {
56  return false;
57  }
58 
59  unsigned srLength = 0;
60  unsigned asbrLength = 0;
61  const char* srValue = extSR->getAttributeByHandle(attrHandle, srLength);
62  const char* asbrValue = extASBR->getAttributeByHandle(attrHandle, asbrLength);
63 
64  return (srLength != asbrLength ||
65  memcmp(srValue, asbrValue, srLength) != 0);
66  }
67 
68  };
69 }
70 
71 
72 #endif
Contains the DtSensorFieldOfViewPublisher class declaration.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)