12#ifndef MCRL2_ATERMPP_FUNCTION_SYMBOL_GENERATOR_H
13#define MCRL2_ATERMPP_FUNCTION_SYMBOL_GENERATOR_H
23 static std::mutex m_function_symbol_generator_mutex;
24 return m_function_symbol_generator_mutex;
63 assert(!prefix.empty() && !(std::isdigit(*prefix.rbegin())));
function_symbol_pool & get_symbol_pool()
void deregister(const std::string &prefix)
Restore the index back to index before registering this prefix. \threadsafe.
std::shared_ptr< std::size_t > register_prefix(const std::string &prefix)
Generates unique function symbols with a given prefix.
std::size_t m_initial_index
Cache the value that is set in the constructor.
void clear()
Restores the index back to the value that was initially assigned in the constructor.
std::size_t m_index
A reference to the index as present in the function symbol generator.
std::string m_string_buffer
A local string cache to prevent allocating new strings for every function symbol generated.
function_symbol operator()(std::size_t arity=0)
Generates a unique function symbol with the given prefix followed by a number.
function_symbol_generator(const std::string &prefix)
Constructor.
~function_symbol_generator()
std::shared_ptr< std::size_t > m_central_index
The address of the central index for this prefix.
aterm_pool & g_term_pool()
obtain a reference to the global aterm pool.
The main namespace for the aterm++ library.
static std::size_t & generator_sequence_number()
static std::mutex & function_symbol_generator_mutex()
static constexpr bool GlobalThreadSafe
Enables thread safety for the whole toolset.
void number2string(std::size_t number, std::string &buffer, std::size_t start_position)
Convert a number to a string in the buffer starting at position start_position.