MAK RTIspy API Documentation for HLA Evolved
netParms.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: netParms.h,v $ $Revision: 1.9 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtNetParam_H_
13 #define DtNetParam_H_
14 
15 #include "rtiMsConfig.h"
16 #include <vlutil/vlNetTypes.h>
17 #include "netRtiMsgHdr.h"
18 #include <vlutil/vlUtil.h>
19 
21 
23 {
24 public:
25  unsigned short totalSize() const;
26  char* valuePtr();
27 
28  MAKRti::DtNetU16 handle;
29  MAKRti::DtNetU16 size;
33 };
34 
35 inline unsigned short DtNetParamValue::totalSize() const
36 {
37  // Start with static header bytes
38  unsigned short hdrSize = sizeof(DtNetParamValue);
39 
40  if (size >= 8)
41  {
42  // Data size >= 64 bit, assume data requires alignment to 64 bit
43  // Adjust header size with padding bytes before data
44  hdrSize += alignedPtrPadding(this+1, 8);
45  }
46 
47  // Adjust total size for padding bytes after data
48  return alignValue(hdrSize+size, 2);
49 }
50 
52 {
53  if (size < 4)
54  return (char*)(&size + 1);
55  else if (size < 8)
56  return (char*)alignPtr(&size + 1, 4);
57  else
58  return (char*)alignPtr(&size + 1, 8);
59 }
60 
62 {
63 public:
64  unsigned long totalSize() const;
65  char* valuePtr();
66 
67  DtNetU32 handle;
68  DtNetU32 size;
72 };
73 
74 inline unsigned long DtNetBigParamValue::totalSize() const
75 {
76  // Start with static header bytes
77  unsigned short hdrSize = sizeof(DtNetBigParamValue);
78 
79  if (size >= 8)
80  {
81  // Data size >= 64 bit, assume data requires alignment to 64 bit
82  // Adjust header size with padding bytes before data
83  hdrSize += alignedPtrPadding(this+1, 8);
84  }
85 
86  // Adjust total size for padding bytes after data
87  return alignValue(hdrSize+size, 4);
88 }
89 
91 {
92  if (size < 8)
93  return (char*)alignPtr(&size + 1, 4);
94  else
95  return (char*)alignPtr(&size + 1, 8);
96 }
97 
99 {
100 public:
101  int baseSize() const;
102 
103  MAKRti::DtNetU16 numParams;
105 };
106 
107 inline int DtNetParams::baseSize() const
108 {
109  return sizeof(DtNetParams);
110 }
111 
113 {
114 public:
115  int baseSize() const;
116 
117  DtNetU32 numParams;
119 };
120 
121 inline int DtNetBigParams::baseSize() const
122 {
123  return sizeof(DtNetBigParams);
124 }
125 
126 #endif

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)