WSF
ProxyChange.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#ifndef PROXYCHANGE_HPP
12#define PROXYCHANGE_HPP
13
14#include "ViExport.hpp"
15#include "WsfPProxyNode.hpp"
16
17namespace wizard
18{
21{
22public:
23 enum Reason
24 {
25 cADDED, // changed() is the item added.
26 cREMOVED, // changed() is the removed item. the node is not valid, but the path is.
27 cRENAMED, // changed() is the item renamed at its new location.
28 cUPDATED, // changed() is the item updated. May have changed any children too.
29 cLIST_INSERTION, // changed() is the new item. other items were shifted right
30 cLIST_DELETION, // changed() is where the item used to be.
31 cOPTIONS_CHANGED, // changed() is the proxy path whose options changed
32 cUNKNOWN //(invalid)
33 };
34
35 ProxyChange(Reason aReason, const WsfPProxyNode& aNode);
36 ProxyChange(Reason aReason, const WsfPProxyNode& aNode, const std::string& aOldName);
37 ~ProxyChange() = default;
38
40 const WsfPProxyPath& path() const { return mChanged.GetPath(); }
42 const WsfPProxyNode& changed() const { return mChanged; }
43
44 // Valid for cRENAMED only; the previous name and path of the object
45 const std::string& oldName() const { return mOldName; }
46 WsfPProxyPath oldPath() const { return mChanged.GetParent().GetPath() + mOldName; }
47
49 Reason reason() const { return mReason; }
50
51private:
52 Reason mReason;
53 WsfPProxyNode mChanged;
54 std::string mOldName;
55};
56} // namespace wizard
57#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfPProxyNode.hpp:60
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
const WsfPProxyPath & path() const
The path changed.
Definition ProxyChange.hpp:40
~ProxyChange()=default
Reason reason() const
What kind of change.
Definition ProxyChange.hpp:49
ProxyChange(Reason aReason, const WsfPProxyNode &aNode)
Definition ProxyChange.cpp:14
const WsfPProxyNode & changed() const
The node changed.
Definition ProxyChange.hpp:42
Reason
Definition ProxyChange.hpp:24
@ cLIST_DELETION
Definition ProxyChange.hpp:30
@ cREMOVED
Definition ProxyChange.hpp:26
@ cOPTIONS_CHANGED
Definition ProxyChange.hpp:31
@ cRENAMED
Definition ProxyChange.hpp:27
@ cADDED
Definition ProxyChange.hpp:25
@ cLIST_INSERTION
Definition ProxyChange.hpp:29
@ cUNKNOWN
Definition ProxyChange.hpp:32
@ cUPDATED
Definition ProxyChange.hpp:28
const std::string & oldName() const
Definition ProxyChange.hpp:45
WsfPProxyPath oldPath() const
Definition ProxyChange.hpp:46
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved