WSF
WsfPProxyKey.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 WSFPPROXYKEY_HPP
16#define WSFPPROXYKEY_HPP
17#include "wsf_parser_export.h"
18
19#include <string>
20
23class WSF_PARSER_EXPORT WsfPProxyKey
24{
25public:
26 enum class KeyType
27 {
28 cSTRING,
29 cINDEX
30 };
31
33 WsfPProxyKey(size_t i);
34 WsfPProxyKey(const std::string& s);
35
36 void SetIndex(size_t aIndex)
37 {
38 mIndex = aIndex;
39 mKeyType = KeyType::cINDEX;
40 }
41 void SetMapKey(const std::string& aMapKey) { mMapKey = aMapKey; }
42 size_t GetIndex() const { return mIndex; }
43 const std::string& GetMapKey() const { return mMapKey; }
44 std::string ToString() const;
45
46 void ClearMapKey() { mMapKey.clear(); }
47
48 bool IsString() const;
49 bool IsIndex() const;
50 bool operator<(const WsfPProxyKey& aRhs) const;
51 bool operator==(const WsfPProxyKey& aRhs) const;
52
53
54private:
55 // Key for map entry
56 std::string mMapKey;
57
58 // Index of list entry or struct entry
59 size_t mIndex;
60
61 KeyType mKeyType;
62};
63#endif
bool operator==(int aId, const WsfStringInt &aRhs)
Equal relational operator for the case of an integer on the LHS and a StringId on the RHS.
Definition WsfStringId.hpp:69
Definition WsfPProxyKey.hpp:24
KeyType
Definition WsfPProxyKey.hpp:27
@ cINDEX
Definition WsfPProxyKey.hpp:29
void SetMapKey(const std::string &aMapKey)
Definition WsfPProxyKey.hpp:41
void ClearMapKey()
Definition WsfPProxyKey.hpp:46
size_t GetIndex() const
Definition WsfPProxyKey.hpp:42
const std::string & GetMapKey() const
Definition WsfPProxyKey.hpp:43
void SetIndex(size_t aIndex)
Definition WsfPProxyKey.hpp:36
WsfPProxyKey()
Definition WsfPProxyKey.cpp:19
Copyrights Multiple, All Rights Reserved