47 const unsigned int lastIndexInOldMap = oldMap.size();
48 if (lastIndexInOldMap + 1 == insertIndex) {
50 m_maps[oldMapID][name] = insertIndex;
53 auto oldMapIter = oldMap.find(name);
54 if (oldMapIter != oldMap.end()) {
55 if (oldMapIter->second == insertIndex) {
60 for (
unsigned int iMap = 0; iMap <
m_maps.size(); iMap++) {
62 const auto it = map.find(name);
63 if (it != map.end() and it->second == insertIndex) {
74 for (
const auto& pair : oldMap) {
75 if (pair.second < insertIndex)
76 map[pair.first] = pair.second;
78 map[name] = insertIndex;
unsigned int getMapForNewVar(const std::string &name)
Return map ID to a map that has 'name' as first entry.
unsigned int getIndex(unsigned int mapID, const std::string &name) const
Find index for name in the given map, or return 0 if not found.
static bool isCompatible(const IndexMap &oldMap, const IndexMap &map, unsigned int insertIndex)
check if all entries in 'oldMap' prior to insertIndex are found in 'map' (with same idx).
std::vector< IndexMap > m_maps
List of string -> index maps.
std::map< std::string, unsigned int > IndexMap
string -> index map.