VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extendedAttributeDecoderHLA.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #ifdef DtHLA
10 
11 #include <vlutil/vlString.h>
12 #include <vl/fom.h>
13 #include <vl/objClassDesc.h>
14 #include <vl/hlaStateDecoder.h>
15 
16 namespace makVrfVrlinkExtToolkit
17 {
18  template <typename StateRepType>
20  {
21  public:
22 
26  static void decodeExtendedAttribute(StateRepType& rep,
27  const RTI::AttributeHandleValuePairSet& attrs, unsigned long pairSetIndex)
28  {
29  StateRepType* extSR = static_cast<StateRepType*>(&rep);
30 
31  // Keep a static buffer so that we're not constantly
32  // deallocating/reallocating memory.
33  std::vector<char> buffer;
34  char* bufPtr = 0;
35 
36  RTI::ULong length = attrs.getValueLength(pairSetIndex);
37  if (length > 0)
38  {
39  buffer.resize(length);
40  bufPtr = &buffer[0];
41  attrs.getValue(pairSetIndex, bufPtr, length);
42  extSR->setAttributeByHandle(attrs.getHandle(pairSetIndex), bufPtr, length);
43  }
44  }
45  };
46 }
47 
48 
49 #endif

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)