WSF
src
core
wsf_parser
source
WsfPProxyStructHeader.hpp
Go to the documentation of this file.
1
// ****************************************************************************
2
// CUI
3
//
4
// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5
//
6
// Copyright 2016 Infoscitex, a DCS Company. All rights reserved.
7
//
8
// The use, dissemination or disclosure of data in this file is subject to
9
// limitation or restriction. See accompanying README and LICENSE for details.
10
// ****************************************************************************
11
12
#ifndef WSFPPROXYSTRUCTHEADER_HPP
13
#define WSFPPROXYSTRUCTHEADER_HPP
14
15
#include "wsf_parser_export.h"
16
17
#include "
WsfPProxyPath.hpp
"
18
class
WsfPProxyStructType
;
19
20
struct
WsfPProxyStructHeader
21
{
22
public
:
23
enum
StructFlags
24
{
25
cSF_POINTER_FMT
= 1,
// if set, the data format consists of a single pointer to the rest of the struct data
26
cSF_EXPANDED_FMT
= 2,
27
cSF_HEADER_TYPE_MASK
= 3,
28
cSF_UNSET
= 4,
// if set, the struct is in an 'unset' state
29
cSF_INHERITED
= 8,
// if set, the struct's value is inherited
30
cSF_CONSTRUCTED
= 0x10
31
};
32
33
const
static
unsigned
int
cSF_INSTANTIATION_MASK
=
cSF_UNSET
;
34
35
// Struct flags
36
int
mStructFlags
;
37
38
#ifdef WSF_PARSE_DEBUG_MEMORY
39
size_t
mInstanceMemoryTraceId;
40
#endif
41
// This points to the start of the struct's data
42
void
*
mStructDataPtr
;
43
// Both inline and non-inline formats always have these two fields:
44
const
WsfPProxyStructType
*
mStructPtr
;
45
// Path to the base struct, indicates inheritance when set.
46
WsfPProxyPath
mBasePath
;
47
48
// add a path to 'this'
49
50
void
*
GetStart
() {
return
mStructDataPtr
; }
51
52
#ifndef NDEBUG
53
void
Constructing
()
54
{
55
assert(0 == (
mStructFlags
&
WsfPProxyStructHeader::cSF_CONSTRUCTED
));
56
mStructFlags
|=
WsfPProxyStructHeader::cSF_CONSTRUCTED
;
57
#ifdef WSF_PARSE_DEBUG_MEMORY
58
mInstanceMemoryTraceId = UtMemoryDebug::AddDetailTrace(
cMDB_PROXY_STRUCT
);
59
#endif
60
}
61
void
Destroying
()
62
{
63
assert(
mStructFlags
&
WsfPProxyStructHeader::cSF_CONSTRUCTED
);
64
mStructFlags
&=
~WsfPProxyStructHeader
::cSF_CONSTRUCTED
;
65
#ifdef WSF_PARSE_DEBUG_MEMORY
66
UtMemoryDebug::RemoveDetailTrace(
cMDB_PROXY_STRUCT
, mInstanceMemoryTraceId);
67
mInstanceMemoryTraceId = 0;
68
#endif
69
}
70
#else
71
void
Constructing
() {}
72
void
Destroying
() {}
73
#endif
74
75
WsfPProxyPath
&
GetBasePath
() {
return
mBasePath
; }
76
};
77
78
#endif
WsfPProxyPath.hpp
cMDB_PROXY_STRUCT
@ cMDB_PROXY_STRUCT
Definition
WsfParseDebugMarkers.hpp:19
WsfPProxyPath
Represents a path or unique key to a value in the proxy.
Definition
WsfPProxyPath.hpp:64
WsfPProxyStructType
Definition
WsfPProxyStructType.hpp:33
WsfPProxyStructHeader
Definition
WsfPProxyStructHeader.hpp:21
WsfPProxyStructHeader::mStructDataPtr
void * mStructDataPtr
Definition
WsfPProxyStructHeader.hpp:42
WsfPProxyStructHeader::cSF_INSTANTIATION_MASK
static const unsigned int cSF_INSTANTIATION_MASK
Definition
WsfPProxyStructHeader.hpp:33
WsfPProxyStructHeader::Destroying
void Destroying()
Definition
WsfPProxyStructHeader.hpp:61
WsfPProxyStructHeader::GetStart
void * GetStart()
Definition
WsfPProxyStructHeader.hpp:50
WsfPProxyStructHeader::Constructing
void Constructing()
Definition
WsfPProxyStructHeader.hpp:53
WsfPProxyStructHeader::GetBasePath
WsfPProxyPath & GetBasePath()
Definition
WsfPProxyStructHeader.hpp:75
WsfPProxyStructHeader::mStructPtr
const WsfPProxyStructType * mStructPtr
Definition
WsfPProxyStructHeader.hpp:44
WsfPProxyStructHeader::StructFlags
StructFlags
Definition
WsfPProxyStructHeader.hpp:24
WsfPProxyStructHeader::cSF_EXPANDED_FMT
@ cSF_EXPANDED_FMT
Definition
WsfPProxyStructHeader.hpp:26
WsfPProxyStructHeader::cSF_INHERITED
@ cSF_INHERITED
Definition
WsfPProxyStructHeader.hpp:29
WsfPProxyStructHeader::cSF_CONSTRUCTED
@ cSF_CONSTRUCTED
Definition
WsfPProxyStructHeader.hpp:30
WsfPProxyStructHeader::cSF_UNSET
@ cSF_UNSET
Definition
WsfPProxyStructHeader.hpp:28
WsfPProxyStructHeader::cSF_POINTER_FMT
@ cSF_POINTER_FMT
Definition
WsfPProxyStructHeader.hpp:25
WsfPProxyStructHeader::cSF_HEADER_TYPE_MASK
@ cSF_HEADER_TYPE_MASK
Definition
WsfPProxyStructHeader.hpp:27
WsfPProxyStructHeader::mStructFlags
int mStructFlags
Definition
WsfPProxyStructHeader.hpp:36
WsfPProxyStructHeader::mBasePath
WsfPProxyPath mBasePath
Definition
WsfPProxyStructHeader.hpp:46
Copyrights Multiple, All Rights Reserved