CBMC
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
depth_iteratort Class Referencefinal

#include <expr_iterator.h>

+ Inheritance diagram for depth_iteratort:
+ Collaboration diagram for depth_iteratort:

Public Member Functions

  Create an end iterator.
 
  Create iterator starting at the supplied node (root) All mutations of the child nodes will be reflected on this node.
 
  depth_iteratort (const exprt &expr, std::function< exprt &()> mutate_root)
  Create iterator starting at the supplied node (root) If mutations of the child nodes are required then the passed mutate_root function will be called to get a non-const copy of the same root on which the mutations will be done.
 
exprtmutate ()
  Obtain non-const reference to the exprt instance currently pointed to by the iterator.
 
- Public Member Functions inherited from depth_iterator_baset< depth_iteratort >
 
 
  Preincrement operator Do not call on the end() iterator.
 
  Post-increment operator Expensive copy.
 
 
  Dereference operator Dereferencing end() iterator is undefined behaviour.
 
  Dereference operator (member access) Dereferencing end() iterator is undefined behaviour.
 

Private Attributes

std::function< exprt &()>  mutate_root
  If this is non-empty then the root is currently const and this function must be called before any mutations occur.
 

Additional Inherited Members

- Public Types inherited from depth_iterator_baset< depth_iteratort >
 
 
 
 
typedef std::forward_iterator_tag  iterator_category
 
- Protected Member Functions inherited from depth_iterator_baset< depth_iteratort >
  Create end iterator.
 
  Create begin iterator, starting at the supplied node.
 
 
 
  Destructor Protected to discourage upcasting.
 
 
 
 
exprtmutate ()
  Obtain non-const exprt reference.
 
  Pushes expression onto the stack If overridden, this function should be called from the inheriting class by the override function.
 

Detailed Description

Definition at line 230 of file expr_iterator.h.

Constructor & Destructor Documentation

◆  depth_iteratort() [1/3]

depth_iteratort::depth_iteratort ( )
default

Create an end iterator.

◆  depth_iteratort() [2/3]

depth_iteratort::depth_iteratort ( exprtexpr )
inlineexplicit

Create iterator starting at the supplied node (root) All mutations of the child nodes will be reflected on this node.

Parameters
expr The root node to begin iteration at

Definition at line 245 of file expr_iterator.h.

◆  depth_iteratort() [3/3]

depth_iteratort::depth_iteratort ( const exprtexpr,
std::function< exprt &()>  mutate_root 
)
inlineexplicit

Create iterator starting at the supplied node (root) If mutations of the child nodes are required then the passed mutate_root function will be called to get a non-const copy of the same root on which the mutations will be done.

Parameters
expr The root node to begin iteration at
mutate_root The function to call to get a non-const copy of the same root expression passed in the expr parameter

Definition at line 256 of file expr_iterator.h.

Member Function Documentation

◆  mutate()

exprt & depth_iteratort::mutate ( )
inline

Obtain non-const reference to the exprt instance currently pointed to by the iterator.

If the iterator is currently using a const root exprt then calls mutate_root to get a non-const root and copies it if it is shared

Returns
A non-const reference to the element this iterator is currently pointing to

Definition at line 272 of file expr_iterator.h.

Member Data Documentation

◆  mutate_root

std::function<exprt &()> depth_iteratort::mutate_root
private

If this is non-empty then the root is currently const and this function must be called before any mutations occur.

Definition at line 236 of file expr_iterator.h.


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

AltStyle によって変換されたページ (->オリジナル) /