|
mCRL2
|
Abstract base class for identifier generators. Identifier generators generate fresh names that do not appear in a given context. A context is maintained containing already used identifiers. Using the operator()() and operator()(std::string) fresh identifiers are generated that do not appear in the context. More...
#include <identifier_generator.h>
Public Member Functions | |
| identifier_generator ()=default | |
| Constructor. | |
| virtual | ~identifier_generator ()=default |
| Destructor. | |
| virtual void | clear_context ()=0 |
| Clears the context. | |
| virtual void | add_identifier (const core::identifier_string &s)=0 |
| Adds the identifier s to the context. | |
| virtual void | remove_identifier (const core::identifier_string &s)=0 |
| Removes the identifier s from the context. | |
| void | add_identifiers (const std::set< core::identifier_string > &ids) |
| Add a set of identifiers to the context. | |
| void | remove_identifiers (const std::set< core::identifier_string > &ids) |
| Remove a set of identifiers from the context. | |
| virtual bool | has_identifier (const core::identifier_string &s) const =0 |
| Returns true if the identifier s appears in the context. | |
| virtual core::identifier_string | operator() (const std::string &hint, bool add_to_context=true) |
| Returns a fresh identifier, with the given hint as prefix. The returned identifier is added to the context. | |
Protected Attributes | |
| Generator | m_generator |
Abstract base class for identifier generators. Identifier generators generate fresh names that do not appear in a given context. A context is maintained containing already used identifiers. Using the operator()() and operator()(std::string) fresh identifiers are generated that do not appear in the context.
Definition at line 30 of file identifier_generator.h.
|
default |
Constructor.
|
virtualdefault |
Destructor.
|
pure virtual |
Adds the identifier s to the context.
| s | An identifier. |
Implemented in mcrl2::data::set_identifier_generator, and mcrl2::data::multiset_identifier_generator.
|
inline |
Add a set of identifiers to the context.
Definition at line 57 of file identifier_generator.h.
|
pure virtual |
Clears the context.
Implemented in mcrl2::data::set_identifier_generator, and mcrl2::data::multiset_identifier_generator.
|
pure virtual |
Returns true if the identifier s appears in the context.
| s | An identifier. |
Implemented in mcrl2::data::set_identifier_generator, and mcrl2::data::multiset_identifier_generator.
|
inlinevirtual |
Returns a fresh identifier, with the given hint as prefix. The returned identifier is added to the context.
| hint | A string |
| add_to_context | If true, the freshly generated identifier is added to the context to make sure no duplicates are generated. |
Reimplemented in mcrl2::data::xyz_identifier_generator.
Definition at line 87 of file identifier_generator.h.
|
pure virtual |
Removes the identifier s from the context.
| s | An identifier. |
Implemented in mcrl2::data::set_identifier_generator, and mcrl2::data::multiset_identifier_generator.
|
inline |
Remove a set of identifiers from the context.
Definition at line 66 of file identifier_generator.h.
|
protected |
Definition at line 33 of file identifier_generator.h.