mCRL2
|
Identifier generator that stores the identifiers of the context in a multiset. If an identifier occurs multiple times, multiple calls to remove_from_context are required to remove it. Using the operator()() and operator()(std::string) fresh identifiers can be generated that do not appear in the context. More...
#include <set_identifier_generator.h>
Public Member Functions | |
multiset_identifier_generator ()=default | |
Constructor. | |
void | clear_context () override |
Clears the context. | |
void | add_identifier (const core::identifier_string &s) override |
Adds the identifier s to the context. | |
void | remove_identifier (const core::identifier_string &s) override |
Removes one occurrence of the identifier s from the context. | |
bool | has_identifier (const core::identifier_string &s) const override |
Returns true if the identifier s appears in the context. | |
const std::multiset< core::identifier_string > & | context () const |
Returns the context. | |
Public Member Functions inherited from mcrl2::data::identifier_generator< Generator > | |
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 | |
std::multiset< core::identifier_string > | m_identifiers |
The context of the identifier generator. | |
Protected Attributes inherited from mcrl2::data::identifier_generator< Generator > | |
Generator | m_generator |
Identifier generator that stores the identifiers of the context in a multiset. If an identifier occurs multiple times, multiple calls to remove_from_context are required to remove it. Using the operator()() and operator()(std::string) fresh identifiers can be generated that do not appear in the context.
Definition at line 85 of file set_identifier_generator.h.
|
default |
Constructor.
|
inlineoverridevirtual |
Adds the identifier s to the context.
s | A |
Implements mcrl2::data::identifier_generator< Generator >.
Definition at line 104 of file set_identifier_generator.h.
|
inlineoverridevirtual |
Clears the context.
Implements mcrl2::data::identifier_generator< Generator >.
Definition at line 96 of file set_identifier_generator.h.
|
inline |
|
inlineoverridevirtual |
Returns true if the identifier s appears in the context.
s | A |
Implements mcrl2::data::identifier_generator< Generator >.
Definition at line 123 of file set_identifier_generator.h.
|
inlineoverridevirtual |
Removes one occurrence of the identifier s from the context.
s | A |
Implements mcrl2::data::identifier_generator< Generator >.
Definition at line 111 of file set_identifier_generator.h.
|
protected |
The context of the identifier generator.
Definition at line 89 of file set_identifier_generator.h.