VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
genericAttributeDecoderHLA.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 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:
24 
28  static void decodeGenericAttribute(StateRepType& rep,
29  const RTI::AttributeHandleValuePairSet& attrs,
30  unsigned long pairSetIndex)
31  {
34 
35  // Keep a static buffer so that we're not constantly
36  // deallocating/reallocating memory.
37  static std::vector<char> buffer;
38  char* bufPtr = 0;
39 
40  RTI::ULong length = attrs.getValueLength(pairSetIndex);
41  buffer.resize(length);
42  if(buffer.size())
43  {
44  bufPtr = &buffer[0];
45  }
46  attrs.getValue(pairSetIndex, bufPtr, length);
47  genSR->setAttributeByHandle(attrs.getHandle(pairSetIndex), bufPtr, length);
48  }
49  };
50 }
51 
52 #endif

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)