Identifier generator that generates names consisting of a prefix followed by a number. For each prefix an index is maintained, that is incremented after each call to operator()(prefix).
More...
#include <number_postfix_generator.h>
|
| number_postfix_generator (std::string hint="FRESH_VAR") |
| Constructor.
|
|
void | add_identifier (const std::string &id) |
| Adds the strings in the range [first, last) to the context.
|
|
template<typename Iter > |
void | add_identifiers (Iter first, Iter last) |
| Adds the strings in the range [first, last) to the context.
|
|
template<typename Iter > |
| number_postfix_generator (Iter first, Iter last, std::string hint="FRESH_VAR") |
| Constructor.
|
|
std::string | operator() (std::string hint, bool add_to_context=true) const |
| Generates a fresh identifier that doesn't appear in the context.
|
|
std::string | operator() () const |
| Generates a fresh identifier that doesn't appear in the context.
|
|
const std::string & | hint () const |
| Returns the default hint.
|
|
std::string & | hint () |
| Returns the default hint.
|
|
void | clear () |
| Clear the context of the generator.
|
|
|
std::map< std::string, std::size_t > | m_index |
| A map that maintains the highest index for each prefix.
|
|
std::string | m_hint |
| The default hint.
|
|
Identifier generator that generates names consisting of a prefix followed by a number. For each prefix an index is maintained, that is incremented after each call to operator()(prefix).
Definition at line 26 of file number_postfix_generator.h.
◆ number_postfix_generator() [1/2]
mcrl2::utilities::number_postfix_generator::number_postfix_generator |
( |
std::string |
hint = "FRESH_VAR" | ) |
|
|
inline |
◆ number_postfix_generator() [2/2]
template<typename Iter >
mcrl2::utilities::number_postfix_generator::number_postfix_generator |
( |
Iter |
first, |
|
|
Iter |
last, |
|
|
std::string |
hint = "FRESH_VAR" |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
first | |
last | |
hint | String hint to use as prefix for generated strings. [first, last) is a sequence of strings that is used as context. |
Definition at line 82 of file number_postfix_generator.h.
◆ add_identifier()
void mcrl2::utilities::number_postfix_generator::add_identifier |
( |
const std::string & |
id | ) |
|
|
inline |
◆ add_identifiers()
template<typename Iter >
void mcrl2::utilities::number_postfix_generator::add_identifiers |
( |
Iter |
first, |
|
|
Iter |
last |
|
) |
| |
|
inline |
Adds the strings in the range [first, last) to the context.
- Parameters
-
first | |
last | [first, last) is a sequence of strings that is used as context. |
Definition at line 68 of file number_postfix_generator.h.
◆ clear()
void mcrl2::utilities::number_postfix_generator::clear |
( |
| ) |
|
|
inline |
◆ hint() [1/2]
std::string & mcrl2::utilities::number_postfix_generator::hint |
( |
| ) |
|
|
inline |
◆ hint() [2/2]
const std::string & mcrl2::utilities::number_postfix_generator::hint |
( |
| ) |
const |
|
inline |
◆ operator()() [1/2]
std::string mcrl2::utilities::number_postfix_generator::operator() |
( |
| ) |
const |
|
inline |
Generates a fresh identifier that doesn't appear in the context.
- Returns
- A fresh identifier.
Definition at line 113 of file number_postfix_generator.h.
◆ operator()() [2/2]
std::string mcrl2::utilities::number_postfix_generator::operator() |
( |
std::string |
hint, |
|
|
bool |
add_to_context = true |
|
) |
| const |
|
inline |
Generates a fresh identifier that doesn't appear in the context.
- Returns
- A fresh identifier.
Definition at line 90 of file number_postfix_generator.h.
◆ m_hint
std::string mcrl2::utilities::number_postfix_generator::m_hint |
|
protected |
◆ m_index
std::map<std::string, std::size_t> mcrl2::utilities::number_postfix_generator::m_index |
|
mutableprotected |
The documentation for this class was generated from the following file: