MAK RTIspy API Documentation for HLA 1.3
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
libsrc
RTI
netAttrs.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1998 MaK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
/*********************************************************************
6
** $RCSfile: netAttrs.h,v $ $Revision: 1.9 $ $State: Exp $
7
*********************************************************************/
8
11
12
#ifndef DtNetAttr_H_
13
#define DtNetAttr_H_
14
15
#include "
rtiMsConfig.h
"
16
#include <vlutil/vlNetTypes.h>
17
#include "
netRtiMsgHdr.h
"
18
#include <vlutil/vlUtil.h>
19
21
22
class
DT_DLL_LRC
DtNetAttrValue
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
DtNetAttrValue::totalSize
()
const
36
{
37
// Start with static header bytes
38
unsigned
short
hdrSize =
sizeof
(
DtNetAttrValue
);
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
51
inline
char
*
DtNetAttrValue::valuePtr
()
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
61
class
DT_DLL_LRC
DtNetBigAttrValue
62
{
63
public
:
64
unsigned
long
totalSize()
const
;
65
char
* valuePtr();
66
67
DtNetU32
handle
;
68
69
DtNetU32
size
;
73
};
74
75
inline
unsigned
long
DtNetBigAttrValue::totalSize
()
const
76
{
77
// Start with static header bytes
78
unsigned
short
hdrSize =
sizeof
(
DtNetBigAttrValue
);
79
80
if
(
size
>= 8)
81
{
82
// Data size >= 64 bit, assume data requires alignment to 64 bit
83
// Adjust header size with padding bytes before data
84
hdrSize += alignedPtrPadding(
this
+1, 8);
85
}
86
87
// Adjust total size for padding bytes after data
88
return
alignValue(hdrSize+
size
, 4);
89
}
90
91
inline
char
*
DtNetBigAttrValue::valuePtr
()
92
{
93
if
(
size
< 8)
94
return
(
char
*)alignPtr(&
size
+ 1, 4);
95
else
96
return
(
char
*)alignPtr(&
size
+ 1, 8);
97
}
98
99
class
DT_DLL_LRC
DtNetAttrs
100
{
101
public
:
102
unsigned
short
baseSize()
const
;
103
104
MAKRti::DtNetU16
numAttrs
;
106
};
107
108
inline
unsigned
short
DtNetAttrs::baseSize
()
const
109
{
110
return
sizeof
(
DtNetAttrs
);
111
}
112
113
class
DT_DLL_LRC
DtNetBigAttrs
114
{
115
public
:
116
unsigned
long
baseSize()
const
;
117
118
DtNetU32
numAttrs
;
120
};
121
122
inline
unsigned
long
DtNetBigAttrs::baseSize
()
const
123
{
124
return
sizeof
(
DtNetBigAttrs
);
125
}
126
127
#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
)