WSF
WsfPProxyDeserialize.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 2003-2015 The Boeing 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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFPPROXYDESERIALIZE_HPP
16#define WSFPPROXYDESERIALIZE_HPP
17class WsfParseNode;
18#include "WsfPProxyI.hpp"
19#include "WsfPProxyIndex.hpp"
20#include "WsfPProxyRegistry.hpp"
21#include "WsfPProxyUndo.hpp"
22
24
25class WSF_PARSER_EXPORT WsfPProxyDeserialize
26{
27public:
28 WsfPProxyDeserialize(WsfPProxyRegistry* aRegistry, WsfPProxyIndex* aIndex = nullptr);
30 void ExecuteInitialActions(WsfPProxyStructValue aStructInstance, WsfParseStruct* aRulePtr);
31
32 void Deserialize(WsfPProxyUndoValue& aContainer, WsfParseNode* aNodePtr);
33
34
35 void AddValue(WsfPProxyValue& aProxyValue);
36
37 WsfPProxyUndoValue& GetBasicRoot() { return mBasicRoot; }
38 WsfPProxyUndoValue GetRoot() const { return mProxyRoot; }
39
40 WsfPProxyRegistry* GetRegistry() const { return mRegistryPtr; }
41 WsfPProxyIndex* GetIndex() const { return mIndexPtr; }
42
43 // Pointer to a boolean that triggers an abort on deserialization.
44 volatile bool* mAbortSwitch;
45
46 bool IsDelayLoading() const { return mDelayLoading; }
47
50 // wsf core does 'delay loading' on some types, automatically sorting the parsing of types
51 // to read base types first. The proxy does the same thing here by keeping a list of nodes
52 // which should be processed after others.
53 using DelayNode = std::pair<size_t, WsfParseNode*>;
54 std::vector<DelayNode> mDelayNodes;
55
56private:
57 void BeginNode(WsfPProxyDeserializeContext& aContext);
58 void EndNode(WsfPProxyDeserializeContext& aContext);
59 volatile bool mNoAbortSwitch;
60 bool mDelayLoading;
61
62 WsfPProxyUndoValue mProxyRoot;
63 WsfPProxyUndoValue mBasicRoot;
64 WsfPProxyRegistry* mRegistryPtr;
65 WsfPProxyIndex* mIndexPtr;
66 std::map<WsfPProxyPath, WsfPProxyPath> mRenameMapping;
67 std::vector<WsfPProxyValue> mIntermediateValues;
68};
69
70#endif
Definition WsfPProxyDeserializeContext.hpp:30
Definition WsfPProxyUndo.hpp:30
Definition WsfPProxyI.hpp:22
WsfPProxyIndex * GetIndex() const
Definition WsfPProxyDeserialize.hpp:41
WsfPProxyRegistry * GetRegistry() const
Definition WsfPProxyDeserialize.hpp:40
WsfPProxyDeserializeObserver * mObserver
Definition WsfPProxyDeserialize.hpp:49
void Deserialize(WsfPProxyUndoValue &aContainer, WsfParseNode *aNodePtr)
Definition WsfPProxyDeserialize.cpp:50
void ExecuteInitialActions(WsfPProxyStructValue aStructInstance, WsfParseStruct *aRulePtr)
Definition WsfPProxyDeserialize.cpp:99
WsfPProxyUndoValue GetRoot() const
Definition WsfPProxyDeserialize.hpp:38
void AddValue(WsfPProxyValue &aProxyValue)
Definition WsfPProxyDeserialize.cpp:81
volatile bool * mAbortSwitch
Definition WsfPProxyDeserialize.hpp:44
WsfPProxyUndoValue & GetBasicRoot()
Definition WsfPProxyDeserialize.hpp:37
WsfPProxyDeserialize(WsfPProxyRegistry *aRegistry, WsfPProxyIndex *aIndex=nullptr)
Definition WsfPProxyDeserialize.cpp:39
std::vector< DelayNode > mDelayNodes
Definition WsfPProxyDeserialize.hpp:54
WsfPProxyDeserializeTracerI * mTraceBuilder
Definition WsfPProxyDeserialize.hpp:48
std::pair< size_t, WsfParseNode * > DelayNode
Definition WsfPProxyDeserialize.hpp:53
bool IsDelayLoading() const
Definition WsfPProxyDeserialize.hpp:46
Definition WsfPProxyIndex.hpp:96
Definition WsfPProxyRegistry.hpp:37
Definition WsfPProxyStructValue.hpp:23
Definition WsfPProxyUndo.hpp:102
Definition WsfPProxyValue.hpp:33
Definition WsfParseNode.hpp:61
Definition WsfParseRule.hpp:527
Copyrights Multiple, All Rights Reserved