VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
managedInterface/messages/attributeChangeRequest.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
10 #pragma once
11 
13 
14 #include <vector>
15 
16 
18 {
19 public:
20 
21 
23  {
24  std::string myName;
25  std::vector<unsigned char> myValue;
26 
27 
28  int size()
29  {
30  int size=0;
31  size+=myName.size() < 128 ? 1 : 2;
32  size+=myName.size();
33 
34  size+=4; //for the count of the items in the list
35  for(unsigned int i=0; i<myValue.size(); i++)
36  {
37  size+=sizeof(unsigned char);
38  }
39 
40 
41  return size;
42  }
43 
44  void serialize(DtStreamWriter& writer)
45  {
46  writer.writeString(myName);
47  writer.writeInt32(myValue.size()); //for the count of the items in the list
48  for(unsigned int i=0; i<myValue.size(); i++)
49  {
50  writer.writeUInt8(myValue[i]);
51  }
52 
53 
54  }
55 
56  void deserialize(DtStreamReader& reader)
57  {
58  myName=reader.readString();
59  unsigned int myValue_count=reader.readInt32(); //for the count of the items in the list
60  for(unsigned int i=0; i<myValue_count; i++)
61  {
62  unsigned char abyte;
63  abyte=reader.readUInt8();
64  myValue.push_back(abyte);
65  }
66 
67  }
68  };
69 
70 
71 
72 
75 
76  virtual std::vector<std::string> getObjectIdentifiers();
77  virtual void setObjectIdentifiers(std::vector<std::string> val);
78 
79  virtual std::vector<AttributePair> getAttributes();
80  virtual void setAttributes(std::vector<AttributePair> val);
81 
82 
83 
84  virtual int messageSize();
85 
86  static DtMessage* decode(unsigned char* buffer, int length);
87  static std::string theMessageName();
88 
89 protected:
90  static std::string theFullName;
91 
92  std::vector<std::string> myObjectIdentifiers;
93  std::vector<AttributePair> myAttributes;
94 
95  virtual void serialize(DtStreamWriter& writer);
96  virtual void deserialize(DtStreamReader& reader);
97 };

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)