CBMC
symbol_table_baset::iteratort Class Reference

#include <symbol_table_base.h>

+ Collaboration diagram for symbol_table_baset::iteratort:

Public Types

typedef symbolst::iterator::difference_type difference_type
 
typedef symbolst::const_iterator::value_type value_type
 
typedef symbolst::const_iterator::pointer pointer
 
typedef symbolst::const_iterator::reference reference
 
typedef symbolst::iterator::iterator_category iterator_category
 

Public Member Functions

 iteratort (symbolst::iterator it)
 
 iteratort (const iteratort &it, std::function< void(const irep_idt &id)> on_get_writeable)
 
 operator symbolst::const_iterator () const
 
bool operator!= (const iteratort &other) const
 
bool operator== (const iteratort &other) const
 
iteratortoperator++ ()
 Preincrement operator Do not call on the end() iterator. More...
 
iteratort operator++ (int)
 Post-increment operator. More...
 
reference operator* () const
 Dereference operator. More...
 
pointer operator-> () const
 Dereference operator (member access) More...
 
symboltget_writeable_symbol ()
 Whereas the dereference operator gives a constant reference to the current symbol, this method allows users to get a writeable reference to the symbol. More...
 

Private Attributes

symbolst::iterator it
 
std::function< void(const irep_idt &id)> on_get_writeable
 

Detailed Description

Definition at line 182 of file symbol_table_base.h.

Member Typedef Documentation

◆ difference_type

typedef symbolst::iterator::difference_type symbol_table_baset::iteratort::difference_type

Definition at line 206 of file symbol_table_base.h.

◆ iterator_category

typedef symbolst::iterator::iterator_category symbol_table_baset::iteratort::iterator_category

Definition at line 210 of file symbol_table_base.h.

◆ pointer

typedef symbolst::const_iterator::pointer symbol_table_baset::iteratort::pointer

Definition at line 208 of file symbol_table_base.h.

◆ reference

typedef symbolst::const_iterator::reference symbol_table_baset::iteratort::reference

Definition at line 209 of file symbol_table_base.h.

◆ value_type

typedef symbolst::const_iterator::value_type symbol_table_baset::iteratort::value_type

Definition at line 207 of file symbol_table_base.h.

Constructor & Destructor Documentation

◆ iteratort() [1/2]

symbol_table_baset::iteratort::iteratort ( symbolst::iterator  it)
inlineexplicit

Definition at line 189 of file symbol_table_base.h.

◆ iteratort() [2/2]

symbol_table_baset::iteratort::iteratort ( const iteratort it,
std::function< void(const irep_idt &id)>  on_get_writeable 
)
inline

Definition at line 193 of file symbol_table_base.h.

Member Function Documentation

◆ get_writeable_symbol()

symbolt& symbol_table_baset::iteratort::get_writeable_symbol ( )
inline

Whereas the dereference operator gives a constant reference to the current symbol, this method allows users to get a writeable reference to the symbol.

Remarks
This method calls the on_get_writeable method first to give derived symbol table classes the opportunity to note that this symbol is being written to before it is accessed.
Returns
A non-const reference to the current symbol.

Definition at line 260 of file symbol_table_base.h.

◆ operator symbolst::const_iterator()

symbol_table_baset::iteratort::operator symbolst::const_iterator ( ) const
inline

Definition at line 200 of file symbol_table_base.h.

◆ operator!=()

bool symbol_table_baset::iteratort::operator!= ( const iteratort other) const
inline

Definition at line 212 of file symbol_table_base.h.

◆ operator*()

reference symbol_table_baset::iteratort::operator* ( ) const
inline

Dereference operator.

Remarks
Dereferencing end() iterator is undefined behaviour

Definition at line 241 of file symbol_table_base.h.

◆ operator++() [1/2]

iteratort& symbol_table_baset::iteratort::operator++ ( )
inline

Preincrement operator Do not call on the end() iterator.

Definition at line 224 of file symbol_table_base.h.

◆ operator++() [2/2]

iteratort symbol_table_baset::iteratort::operator++ ( int  )
inline

Post-increment operator.

Remarks
Expensive copy. Avoid if possible.

Definition at line 232 of file symbol_table_base.h.

◆ operator->()

pointer symbol_table_baset::iteratort::operator-> ( ) const
inline

Dereference operator (member access)

Remarks
Dereferencing end() iterator is undefined behaviour

Definition at line 248 of file symbol_table_base.h.

◆ operator==()

bool symbol_table_baset::iteratort::operator== ( const iteratort other) const
inline

Definition at line 217 of file symbol_table_base.h.

Member Data Documentation

◆ it

symbolst::iterator symbol_table_baset::iteratort::it
private

Definition at line 185 of file symbol_table_base.h.

◆ on_get_writeable

std::function<void(const irep_idt &id)> symbol_table_baset::iteratort::on_get_writeable
private

Definition at line 186 of file symbol_table_base.h.


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