atermpp::function_symbol_generator

Include file:

#include "mcrl2/atermpp/function_symbol_generator.h
class atermpp::function_symbol_generator

Generates unique function symbols with a given prefix.

Protected attributes

std::shared_ptr<std::size_t> atermpp::function_symbol_generator::m_central_index

The address of the central index for this prefix.

std::size_t atermpp::function_symbol_generator::m_index

A reference to the index as present in the function symbol generator.

std::size_t atermpp::function_symbol_generator::m_initial_index

Cache the value that is set in the constructor.

std::string atermpp::function_symbol_generator::m_prefix
std::string atermpp::function_symbol_generator::m_string_buffer

A local string cache to prevent allocating new strings for every function symbol generated.

Public member functions

void clear()

Restores the index back to the value that was initially assigned in the constructor.

function_symbol_generator(const std::string &prefix)

Constructor.

Parameters:

  • prefix The prefix of the generated generated strings.

Pre: The prefix may not be empty, and it may not have trailing digits

function_symbol operator()(std::size_t arity = 0)

Generates a unique function symbol with the given prefix followed by a number.

~function_symbol_generator()