cprover
class_hierarchyt Class Reference

#include <class_hierarchy.h>

Collaboration diagram for class_hierarchyt:
[legend]

Classes

class  entryt
 

Public Types

typedef std::vector< irep_idtidst
 
typedef std::map< irep_idt, entrytclass_mapt
 

Public Member Functions

void operator() (const symbol_tablet &)
 Looks for all the struct types in the symbol table and construct a map from class names to a data structure that contains lists of parent and child classes for each struct type (ie class). More...
 
idst get_children_trans (const irep_idt &id) const
 
idst get_parents_trans (const irep_idt &id) const
 
void output (std::ostream &, bool children_only) const
 Output the class hierarchy in plain text. More...
 
void output_dot (std::ostream &) const
 Output class hierarchy in Graphviz DOT format. More...
 
void output (json_stream_arrayt &, bool children_only) const
 Output the class hierarchy in JSON format. More...
 

Public Attributes

class_mapt class_map
 

Protected Member Functions

void get_children_trans_rec (const irep_idt &, idst &) const
 
void get_parents_trans_rec (const irep_idt &, idst &) const
 Get all the classes that inherit (directly or indirectly) from class c. More...
 

Detailed Description

Definition at line 37 of file class_hierarchy.h.

Member Typedef Documentation

◆ class_mapt

Definition at line 49 of file class_hierarchy.h.

◆ idst

typedef std::vector<irep_idt> class_hierarchyt::idst

Definition at line 40 of file class_hierarchy.h.

Member Function Documentation

◆ get_children_trans()

idst class_hierarchyt::get_children_trans ( const irep_idt id) const
inline

◆ get_children_trans_rec()

void class_hierarchyt::get_children_trans_rec ( const irep_idt c,
idst dest 
) const
protected

Definition at line 91 of file class_hierarchy.cpp.

References class_hierarchyt::entryt::children, and class_map.

Referenced by get_children_trans().

◆ get_parents_trans()

idst class_hierarchyt::get_parents_trans ( const irep_idt id) const
inline

Definition at line 63 of file class_hierarchy.h.

References get_parents_trans_rec().

Referenced by taint_analysist::instrument().

◆ get_parents_trans_rec()

void class_hierarchyt::get_parents_trans_rec ( const irep_idt c,
idst dest 
) const
protected

Get all the classes that inherit (directly or indirectly) from class c.

The first element(s) will be the immediate parents of c, though after this the order is all the parents of the first immediate parent

Parameters
cThe class to consider
[out]destA list of class ids that c eventually inherits from.

Definition at line 113 of file class_hierarchy.cpp.

References class_map, and class_hierarchyt::entryt::parents.

Referenced by get_parents_trans().

◆ operator()()

void class_hierarchyt::operator() ( const symbol_tablet symbol_table)

Looks for all the struct types in the symbol table and construct a map from class names to a data structure that contains lists of parent and child classes for each struct type (ie class).

Parameters
symbol_tableThe symbol table to analyze

Definition at line 26 of file class_hierarchy.cpp.

References class_map, dstringt::empty(), irept::find(), irept::get_bool(), irept::get_sub(), symbol_table_baset::symbols, and to_struct_type().

◆ output() [1/2]

void class_hierarchyt::output ( std::ostream &  out,
bool  children_only 
) const

Output the class hierarchy in plain text.

Parameters
outthe output stream
children_onlyprint the children only and do not print the parents

Definition at line 133 of file class_hierarchy.cpp.

References class_map.

Referenced by show_class_hierarchy().

◆ output() [2/2]

void class_hierarchyt::output ( json_stream_arrayt json_stream,
bool  children_only 
) const

Output the class hierarchy in JSON format.

Parameters
json_streamthe output JSON stream array
children_onlyprint the children only and do not print the parents

Definition at line 173 of file class_hierarchy.cpp.

References class_map, jsont::json_boolean(), json_stream_arrayt::push_back(), json_stream_objectt::push_back_stream_array(), and json_stream_arrayt::push_back_stream_object().

◆ output_dot()

void class_hierarchyt::output_dot ( std::ostream &  ostr) const

Output class hierarchy in Graphviz DOT format.

Parameters
ostrstream to write DOT to

Definition at line 152 of file class_hierarchy.cpp.

References class_map.

Referenced by goto_instrument_parse_optionst::doit().

Member Data Documentation

◆ class_map


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