CBMC
tree_nodet< treet, named_subtreest, sharing > Class Template Reference

A node with data in a tree, it contains: More...

#include <irep.h>

+ Inheritance diagram for tree_nodet< treet, named_subtreest, sharing >:
+ Collaboration diagram for tree_nodet< treet, named_subtreest, sharing >:

Public Types

typedef std::vector< treetsubt
 
using named_subt = named_subtreest
 

Public Member Functions

void clear ()
 
void swap (tree_nodet &d)
 
 tree_nodet ()=default
 
 tree_nodet (irep_idt _data)
 
 tree_nodet (irep_idt _data, named_subt _named_sub, subt _sub)
 

Public Attributes

friend treet
 
irep_idt data
 This irep_idt is the only place to store data in an tree node. More...
 
named_subt named_sub
 
subt sub
 
std::size_t hash_code = 0
 
- Public Attributes inherited from ref_count_ift< true >
unsigned ref_count = 1
 

Detailed Description

template<typename treet, typename named_subtreest, bool sharing = true>
class tree_nodet< treet, named_subtreest, sharing >

A node with data in a tree, it contains:

  • irept::dt::data : A dstringt and thus an integer which is a reference into a string table.)
  • irept::dt::named_sub : A map from irep_idt (a string) to irept. This is used for named children, i.e. subexpressions, parameters, etc. Children whose name begins with '#' are ignored by the default operator==.
  • irept::dt::sub : A vector of irept which is used to store ordered but unnamed children.
  • ref_count : if sharing is activated, this is used to count the number of references to a node.
  • hash_code : if HASH_CODE is activated, this is used to cache the result of the hash function.

Definition at line 89 of file irep.h.

Member Typedef Documentation

◆ named_subt

template<typename treet , typename named_subtreest , bool sharing = true>
using tree_nodet< treet, named_subtreest, sharing >::named_subt = named_subtreest

Definition at line 98 of file irep.h.

◆ subt

template<typename treet , typename named_subtreest , bool sharing = true>
typedef std::vector<treet> tree_nodet< treet, named_subtreest, sharing >::subt

Definition at line 93 of file irep.h.

Constructor & Destructor Documentation

◆ tree_nodet() [1/3]

template<typename treet , typename named_subtreest , bool sharing = true>
tree_nodet< treet, named_subtreest, sharing >::tree_nodet ( )
default

◆ tree_nodet() [2/3]

template<typename treet , typename named_subtreest , bool sharing = true>
tree_nodet< treet, named_subtreest, sharing >::tree_nodet ( irep_idt  _data)
inlineexplicit

Definition at line 134 of file irep.h.

◆ tree_nodet() [3/3]

template<typename treet , typename named_subtreest , bool sharing = true>
tree_nodet< treet, named_subtreest, sharing >::tree_nodet ( irep_idt  _data,
named_subt  _named_sub,
subt  _sub 
)
inline

Definition at line 138 of file irep.h.

Member Function Documentation

◆ clear()

template<typename treet , typename named_subtreest , bool sharing = true>
void tree_nodet< treet, named_subtreest, sharing >::clear ( void  )
inline

Definition at line 112 of file irep.h.

◆ swap()

template<typename treet , typename named_subtreest , bool sharing = true>
void tree_nodet< treet, named_subtreest, sharing >::swap ( tree_nodet< treet, named_subtreest, sharing > &  d)
inline

Definition at line 122 of file irep.h.

Member Data Documentation

◆ data

template<typename treet , typename named_subtreest , bool sharing = true>
irep_idt tree_nodet< treet, named_subtreest, sharing >::data

This irep_idt is the only place to store data in an tree node.

Definition at line 103 of file irep.h.

◆ hash_code

template<typename treet , typename named_subtreest , bool sharing = true>
std::size_t tree_nodet< treet, named_subtreest, sharing >::hash_code = 0
mutable

Definition at line 109 of file irep.h.

◆ named_sub

template<typename treet , typename named_subtreest , bool sharing = true>
named_subt tree_nodet< treet, named_subtreest, sharing >::named_sub

Definition at line 105 of file irep.h.

◆ sub

template<typename treet , typename named_subtreest , bool sharing = true>
subt tree_nodet< treet, named_subtreest, sharing >::sub

Definition at line 106 of file irep.h.

◆ treet

template<typename treet , typename named_subtreest , bool sharing = true>
friend tree_nodet< treet, named_subtreest, sharing >::treet

Definition at line 100 of file irep.h.


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