mCRL2
|
Identifier generator that generates names from the range X, Y, Z, X0, Y0, Z0, X1, ... More...
#include <xyz_identifier_generator.h>
Public Member Functions | |
xyz_identifier_generator () | |
Constructor. | |
xyz_identifier_generator (const std::set< core::identifier_string > &ids) | |
Constructor. | |
core::identifier_string | operator() (const std::string &hint, bool add_to_context=true) |
Returns hint if it isn't in the context yet. Else the next available identifier in the range X, Y, Z, X0, Y0, Z0, X1, ... is returned. | |
Public Member Functions inherited from mcrl2::data::multiset_identifier_generator | |
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 Member Functions | |
std::string | next () |
Returns the next name in the range X, Y, Z, X0, Y0, Z0, X1, ... | |
Protected Attributes | |
int | m_index |
The index of the last generated identifier. | |
char | m_char |
The character of the last generated identifier. | |
Protected Attributes inherited from mcrl2::data::multiset_identifier_generator | |
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 generates names from the range X, Y, Z, X0, Y0, Z0, X1, ...
Definition at line 24 of file xyz_identifier_generator.h.
|
inline |
Constructor.
Definition at line 61 of file xyz_identifier_generator.h.
|
inline |
Constructor.
ids | a set of identifiers to use as context |
Definition at line 67 of file xyz_identifier_generator.h.
|
inlineprotected |
Returns the next name in the range X, Y, Z, X0, Y0, Z0, X1, ...
Definition at line 35 of file xyz_identifier_generator.h.
|
inlinevirtual |
Returns hint if it isn't in the context yet. Else the next available identifier in the range X, Y, Z, X0, Y0, Z0, X1, ... is returned.
hint | A string |
add_to_context | If true, the generated identifier is added to the context, it is not added otherwise. |
Reimplemented from mcrl2::data::identifier_generator< Generator >.
Definition at line 79 of file xyz_identifier_generator.h.
|
protected |
The character of the last generated identifier.
Definition at line 31 of file xyz_identifier_generator.h.
|
protected |
The index of the last generated identifier.
Definition at line 28 of file xyz_identifier_generator.h.