mCRL2
Loading...
Searching...
No Matches
mcrl2::data::set_identifier_generator Class Reference

Identifier generator that stores the identifiers of the context in a set. 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>

Inheritance diagram for mcrl2::data::set_identifier_generator:
mcrl2::data::identifier_generator< Generator >

Public Member Functions

 set_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::set< 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::set< core::identifier_stringm_identifiers
 The context of the identifier generator.
 
- Protected Attributes inherited from mcrl2::data::identifier_generator< Generator >
Generator m_generator
 

Detailed Description

Identifier generator that stores the identifiers of the context in a set. Using the operator()() and operator()(std::string) fresh identifiers can be generated that do not appear in the context.

Definition at line 29 of file set_identifier_generator.h.

Constructor & Destructor Documentation

◆ set_identifier_generator()

mcrl2::data::set_identifier_generator::set_identifier_generator ( )
default

Constructor.

Member Function Documentation

◆ add_identifier()

void mcrl2::data::set_identifier_generator::add_identifier ( const core::identifier_string s)
inlineoverridevirtual

Adds the identifier s to the context.

Parameters
sA

Implements mcrl2::data::identifier_generator< Generator >.

Definition at line 48 of file set_identifier_generator.h.

◆ clear_context()

void mcrl2::data::set_identifier_generator::clear_context ( )
inlineoverridevirtual

Clears the context.

Implements mcrl2::data::identifier_generator< Generator >.

Definition at line 40 of file set_identifier_generator.h.

◆ context()

const std::set< core::identifier_string > & mcrl2::data::set_identifier_generator::context ( ) const
inline

Returns the context.

Returns
The context.

Definition at line 71 of file set_identifier_generator.h.

◆ has_identifier()

bool mcrl2::data::set_identifier_generator::has_identifier ( const core::identifier_string s) const
inlineoverridevirtual

Returns true if the identifier s appears in the context.

Parameters
sA
Returns
True if the identifier s appears in the context.

Implements mcrl2::data::identifier_generator< Generator >.

Definition at line 63 of file set_identifier_generator.h.

◆ remove_identifier()

void mcrl2::data::set_identifier_generator::remove_identifier ( const core::identifier_string s)
inlineoverridevirtual

Removes one occurrence of the identifier s from the context.

Parameters
sA

Implements mcrl2::data::identifier_generator< Generator >.

Definition at line 55 of file set_identifier_generator.h.

Member Data Documentation

◆ m_identifiers

std::set<core::identifier_string> mcrl2::data::set_identifier_generator::m_identifiers
protected

The context of the identifier generator.

Definition at line 33 of file set_identifier_generator.h.


The documentation for this class was generated from the following file: