Minsky
valueId.h
Go to the documentation of this file.
1 /*
2  @copyright Steve Keen 2021
3  @author Russell Standish
4  This file is part of Minsky.
5 
6  Minsky is free software: you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Minsky is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Minsky. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef VALUEID_H
21 #define VALUEID_H
22 #include <memory>
23 #include <string>
24 
25 namespace minsky
26 {
27  class Group;
28  typedef std::shared_ptr<Group> GroupPtr;
29 
31  bool isValueId(const std::string& name);
32 
34  std::string valueIdCanonical(size_t scope, const std::string& name);
36  std::string valueId(const std::string& name);
37 
40  std::string valueId(const GroupPtr& ref, const std::string& name);
41 
43  std::string canonicalName(const std::string& name);
44 
47  GroupPtr scope(GroupPtr ref, const std::string& name);
48 
50  std::string valueIdFromScope(const GroupPtr& scope, const std::string& name);
51 
54  size_t scope(const std::string& name);
56  std::string uqName(const std::string& name);
57 }
58 #endif
string valueIdCanonical(size_t scope, const string &name)
construct a valueId @ name should be canonicalised
Definition: valueId.cc:68
size_t scope(const string &name)
extract scope from a qualified variable name
Definition: valueId.cc:83
std::string uqName(const std::string &name)
extract unqualified portion of name
Definition: valueId.cc:135
string valueId(const string &name)
construct a valueId from fully qualified name @ name should not be canonicalised
Definition: valueId.cc:75
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky&#39;s state cha...
Definition: constMap.h:22
string canonicalName(const string &name)
convert a raw name into a canonical name - this is not idempotent.
Definition: valueId.cc:63
bool isValueId(const string &name)
check that name is a valid valueId (useful for assertions)
Definition: valueId.cc:33
string valueIdFromScope(const GroupPtr &scope, const std::string &name)
value Id from scope and canonical name name
Definition: valueId.cc:128
std::shared_ptr< Group > GroupPtr
Definition: port.h:32