WSF
WsfStringId.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 WSFSTRINGID_HPP
13#define WSFSTRINGID_HPP
14
15#include "wsf_export.h"
16
17#include <iosfwd>
18#include <string>
19
20#include "UtStringId.hpp"
21
23using WsfStringId = UtStringId;
24
29{
30public:
31 WsfStringInt(const std::string& aSrc)
32 : WsfStringId(aSrc)
33 {
34 }
35 WsfStringInt(const char* aSrc)
36 : WsfStringId(aSrc)
37 {
38 }
40 : WsfStringId(aRhs)
41 {
42 }
43 explicit WsfStringInt(int aId)
44 : WsfStringId()
45 {
46 mId = aId;
47 }
49 : WsfStringId()
50 {
51 }
52
53 operator int() const { return mId; }
55 {
56 mId = aRhs;
57 return *this;
58 }
59 bool operator==(const WsfStringInt& aRhs) const { return (mId == aRhs.mId); }
60 bool operator!=(const WsfStringInt& aRhs) const { return (mId != aRhs.mId); }
61
62 friend bool operator==(int aId, const WsfStringInt& aRhs);
63 friend bool operator!=(int aId, const WsfStringInt& aRhs);
64
65 operator const std::string&() const { return (const WsfStringId&)*this; }
66};
67
69inline bool operator==(int aId, const WsfStringInt& aRhs)
70{
71 return (aId == aRhs.GetId());
72}
73
75inline bool operator!=(int aId, const WsfStringInt& aRhs)
76{
77 return (aId != aRhs.GetId());
78}
79
80#endif
bool operator!=(int aId, const WsfStringInt &aRhs)
Not equal relational operator for the case of an integer on the LHS and a StringId on the RHS.
Definition WsfStringId.hpp:75
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
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfStringId.hpp:29
bool operator!=(const WsfStringInt &aRhs) const
Definition WsfStringId.hpp:60
WsfStringInt(int aId)
Definition WsfStringId.hpp:43
WsfStringInt(const WsfStringId &aRhs)
Definition WsfStringId.hpp:39
WsfStringInt(const char *aSrc)
Definition WsfStringId.hpp:35
WsfStringInt & operator=(int aRhs)
Definition WsfStringId.hpp:54
WsfStringInt()
Definition WsfStringId.hpp:48
bool operator==(const WsfStringInt &aRhs) const
Definition WsfStringId.hpp:59
WsfStringInt(const std::string &aSrc)
Definition WsfStringId.hpp:31
Copyrights Multiple, All Rights Reserved