VR-Forces 4.10 Class Documentation
 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  static std::vector<char> buffer;
34  char* bufPtr = 0;
35 
36  RTI::ULong length = attrs.getValueLength(pairSetIndex);
37  buffer.resize(length);
38  if (buffer.size())
39  {
40  bufPtr = &buffer[0];
41  }
42  attrs.getValue(pairSetIndex, bufPtr, length);
43  extSR->setAttributeByHandle(attrs.getHandle(pairSetIndex), bufPtr, length);
44  }
45  };
46 }
47 
48 
49 #endif

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)