Go to the documentation of this file.
14 #ifndef CPROVER_GOTO_PROGRAMS_CLASS_HIERARCHY_H
15 #define CPROVER_GOTO_PROGRAMS_CLASS_HIERARCHY_H
19 #include <unordered_map>
25 #define OPT_SHOW_CLASS_HIERARCHY \
26 "(show-class-hierarchy)"
28 #define HELP_SHOW_CLASS_HIERARCHY \
29 " --show-class-hierarchy show the class hierarchy\n"
45 typedef std::vector<irep_idt>
idst;
62 (*this)(symbol_table);
83 void output(std::ostream &,
bool children_only)
const;
105 typedef std::vector<irep_idt>
idst;
141 bool children_only =
false);
143 #endif // CPROVER_GOTO_PROGRAMS_CLASS_HIERARCHY_H
std::vector< irep_idt > idst
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
idst get_parents_trans(const irep_idt &c) const
Get all the classes that class c inherits from (directly or indirectly).
idst ids_from_indices(const std::vector< node_indext > &nodes) const
Helper function that converts a vector of node_indext to a vector of ids that are stored in the corre...
Non-graph-based representation of the class hierarchy.
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 str...
void output(std::ostream &, bool children_only) const
Output the class hierarchy in plain text.
void get_children_trans_rec(const irep_idt &, idst &) const
A generic directed graph with a parametric node type.
void get_parents_trans_rec(const irep_idt &, idst &) const
Get all the classes that class c inherits from (directly or indirectly).
idst get_children_trans(const irep_idt &c) const
Get all the classes that inherit (directly or indirectly) from class c.
class_hierarchyt()=default
class_hierarchyt & operator=(const class_hierarchyt &)=delete
irep_idt class_identifier
Class ID for this node.
std::unordered_map< irep_idt, node_indext > nodes_by_namet
Maps class identifiers onto node indices.
nodes_by_namet nodes_by_name
Maps class identifiers onto node indices.
Provides methods for streaming JSON arrays.
class_hierarchyt(const symbol_tablet &symbol_table)
void show_class_hierarchy(const class_hierarchyt &hierarchy, ui_message_handlert &message_handler, bool children_only=false)
Output the class hierarchy.
std::vector< irep_idt > idst
const nodes_by_namet & get_nodes_by_class_identifier() const
Get map from class identifier to node index.
std::map< irep_idt, entryt > class_mapt
This class represents a node in a directed graph.
Class hierarchy, represented using grapht and therefore suitable for use with generic graph algorithm...
idst get_other_reachable_ids(const irep_idt &c, bool forwards) const
Helper function for get_children_trans and get_parents_trans
Class hierarchy graph node: simply contains a class identifier.
void output_dot(std::ostream &) const
Output class hierarchy in Graphviz DOT format.
idst get_parents_trans(const irep_idt &id) const
idst get_direct_children(const irep_idt &c) const
Get all the classes that directly (i.e.
idst get_children_trans(const irep_idt &id) const
void populate(const symbol_tablet &)
Populate the class hierarchy graph, such that there is a node for every struct type in the symbol tab...