13#ifndef MCRL2_ATERMPP_INDEX_TRAITS_H
14#define MCRL2_ATERMPP_INDEX_TRAITS_H
24template <
typename Variable,
typename KeyType>
31template <
typename Variable,
typename KeyType>
34 static std::stack<std::size_t> s;
38template <
typename Variable,
typename KeyType>
46template <
typename Variable,
typename KeyType>
62template <
typename Variable,
typename KeyType, const
int N>
69 std::size_t
index(
const Variable& x)
79 return variable_map_max_index<Variable, KeyType>();
89 auto& m = variable_index_map<Variable, KeyType>();
94 auto& s = variable_map_free_numbers<Variable, KeyType>();
98 variable_map_max_index<Variable, KeyType>() = value;
122 auto& m = variable_index_map<Variable, KeyType>();
123 auto& s = variable_map_free_numbers<Variable, KeyType>();
125 assert(i != m.end());
137 auto& m = variable_index_map<Variable, KeyType>();
This file contains an implementation of the hash function to break circular header dependencies.
The underlying integer term that actually carries the integer data.
std::size_t value() const noexcept
A unordered_map class in which aterms can be stored.
_aterm * address(const unprotected_aterm_core &t)
std::stack< std::size_t > & variable_map_free_numbers()
atermpp::unordered_map< KeyType, std::size_t > & variable_index_map()
std::mutex & variable_mutex()
std::size_t & variable_map_max_index()
The main namespace for the aterm++ library.
static constexpr bool GlobalThreadSafe
Enables thread safety for the whole toolset.
For several variable types in mCRL2 an implicit mapping of these variables to integers is available....
static std::size_t size()
Note: intended for internal use only! Provides the size of the variable index map.
static void erase(const KeyType &x)
Note: intended for internal use only! Removes the variable from the index map.
static std::size_t max_index()
Returns an upper bound for the largest index of a variable that is currently in use.
static std::size_t insert(const KeyType &x)
Note: intended for internal use only! Returns the index of the variable. If the variable was not alre...
static std::size_t index(const Variable &x)
Returns the index of the variable.