WSF
ProxyWatchNode.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#ifndef PROXYWATCHNODE_HPP
13#define PROXYWATCHNODE_HPP
14
15#include <map>
16
17#include "UtCallback.hpp"
18#include "ViExport.hpp"
19#include "WsfPProxyKey.hpp"
20
21class WsfPProxyPath;
22
23namespace wizard
24{
25class ProxyChange;
26
27// A Trie of paths being watched
29{
30public:
31 typedef UtCallbackListN<void(const ProxyChange&)> UpdateCallbackList;
32 friend class ProxyWatcher_Merger;
33 friend class ProxyWatcher;
34
36 ~ProxyWatchNode() = default;
37
38 // Called when a value or one of its members have been directly changed
41
42 // Called anytime a value owned directly or indirectly has been changed
44
45private:
46 void Merge(ProxyWatchNode& aNode);
47 void EmitChange(const ProxyChange&);
48 void EmitChangeReverse(const ProxyChange& aChange);
49 void EmitChangeImmediate(const ProxyChange& aChange);
50 void EmitAnyUpdateImmediate(const ProxyChange& aChange);
51 void EmitChildUpdateImmediate(const ProxyChange& aChange);
52 void EmitThisUpdateImmediate(const ProxyChange& aChange);
53
54 ProxyWatchNode& GetChild(const WsfPProxyPath& aPath);
55 ProxyWatchNode& GetChild(const WsfPProxyKey& aKey);
56 ProxyWatchNode* FindChild(const WsfPProxyPath& aPath, int aMaxDepth = 10000);
57 ProxyWatchNode* FindLeaf(const WsfPProxyPath& aPath);
58
59 bool CanPrune() const;
60
61 typedef std::map<WsfPProxyKey, ProxyWatchNode> ChildMap;
62
63 ProxyWatchNode* mParent;
64 int mDepth;
65 ChildMap mChildren;
66};
67} // namespace wizard
68#endif // PROXYWATCHNODE_HPP
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfPProxyKey.hpp:24
Represents a path or unique key to a value in the proxy.
Definition WsfPProxyPath.hpp:64
Records a change to proxy data.
Definition ProxyChange.hpp:21
friend class ProxyWatcher
Definition ProxyWatchNode.hpp:33
UpdateCallbackList ThisUpdate
Definition ProxyWatchNode.hpp:40
UpdateCallbackList ChildUpdate
Definition ProxyWatchNode.hpp:39
friend class ProxyWatcher_Merger
Definition ProxyWatchNode.hpp:32
UtCallbackListN< void(const ProxyChange &)> UpdateCallbackList
Definition ProxyWatchNode.hpp:31
UpdateCallbackList AnyUpdate
Definition ProxyWatchNode.hpp:43
ProxyWatchNode()
Definition ProxyWatchNode.cpp:16
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved