WSF
WsfPProxyBasicValue.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 WSFPPROXYBASICVALUE_HPP
13#define WSFPPROXYBASICVALUE_HPP
14
15#include "wsf_parser_export.h"
16
17// clang-format off
18#include "WsfPProxyValue.hpp"
19#include "WsfPProxyType.hpp"
20// clang-format on
21
22// When WSF_PROXY_VALUE_DEBUG is defined, we save the string representation of the value after
23// each change. This lets you easily see the value in the debugger, but requires a lot of overhead.
24//
25//#define WSF_PROXY_VALUE_DEBUG
26
27// A Wrapper to hold / operate on a proxy value with a basic type
28class WSF_PARSER_EXPORT WsfPProxyBasicValue : public WsfPProxyValue
29{
30public:
35
37 WsfPProxyBasicValue(void* aDataPtr, WsfPProxyBasicType* aTypePtr);
39 std::string ToString() const;
40 int ToInt() const;
41 void Read(WsfParseNode* aNodePtr);
42 void SetValue(const std::string& aText);
43
44 void SetValue(WsfParseNode* aNodePtr);
45
46 void SetUnset();
47
48 void Negate();
49 bool IsEqual(const WsfPProxyValue& aRhs) const;
50#ifdef WSF_PROXY_VALUE_DEBUG
51 void ValueChanged() { mStringValue = ToString(); }
52 std::string mStringValue;
53#else
54 void ValueChanged() {} // no-op
55#endif
56};
57
58#endif
Definition WsfPProxyType.hpp:114
Definition WsfPProxyBasicValue.hpp:29
WsfPProxyBasicValue()
Definition WsfPProxyBasicValue.hpp:31
void ValueChanged()
Definition WsfPProxyBasicValue.hpp:54
WsfPProxyBasicType * GetType() const
Definition WsfPProxyBasicValue.hpp:38
Definition WsfPProxyValue.hpp:33
void SetUnset()
Definition WsfPProxyValue.cpp:85
WsfPProxyValue()
Definition WsfPProxyValue.hpp:35
void SetValue(const std::string &aText)
Definition WsfPProxyValue.cpp:229
const WsfPProxyType * mTypePtr
Definition WsfPProxyValue.hpp:196
Definition WsfParseNode.hpp:61
Copyrights Multiple, All Rights Reserved