libabigail
Loading...
Searching...
No Matches
class_or_union_diff Class Reference

This is the base class of class_diff and union_diff. More...

#include <abg-comparison.h>

Inheritance diagram for class_or_union_diff:
[legend]

Classes

struct  priv
 The type of private data of class_or_union_diff. More...
 

Public Member Functions

virtual ~class_or_union_diff ()
 Destructor of class_or_union_diff.
 
virtual void chain_into_hierarchy ()
 Populate the vector of children node of the diff base type sub-object of this instance of class_or_union_diff.
 
const unsigned_var_diff_sptr_mapchanged_data_members () const
 Getter of the map of data members that got replaced by another data member. The key of the map is the offset at which the element got replaced and the value is a pointer to the var_diff representing the replacement of the data member.
 
const function_decl_diff_sptrs_typechanged_member_fns () const
 Getter for the virtual members functions that have had a change in a sub-type, without having a change in their symbol name.
 
size_t count_filtered_changed_data_members (bool local_only=false) const
 Count the number of /filtered/ data members that got replaced by another data member.
 
size_t count_filtered_subtype_changed_data_members (bool local_only=false) const
 Count the number of /filtered/ data members with a sub-type change.
 
edit_scriptdata_members_changes ()
 
const edit_scriptdata_members_changes () const
 
const string_decl_base_sptr_mapdata_members_replaced_by_adms () const
 Get the map of data members that got replaced by anonymous data members.
 
const string_decl_base_sptr_mapdeleted_data_members () const
 Getter for the data members that got deleted.
 
const string_member_function_sptr_mapdeleted_member_fns () const
 
class_or_union_sptr first_class_or_union () const
 
const class_or_union_diff::priv_ptr & get_priv () const
 Getter of the private data of the class_or_union_diff type.
 
virtual bool has_changes () const
 Test if the current diff node carries a change.
 
virtual enum change_kind has_local_changes () const
 
const string_decl_base_sptr_mapinserted_data_members () const
 Getter for the data members that got inserted.
 
const string_member_function_sptr_mapinserted_member_fns () const
 
edit_scriptmember_class_tmpls_changes ()
 
const edit_scriptmember_class_tmpls_changes () const
 
edit_scriptmember_fn_tmpls_changes ()
 
const edit_scriptmember_fn_tmpls_changes () const
 
edit_scriptmember_fns_changes ()
 
const edit_scriptmember_fns_changes () const
 
edit_scriptmember_types_changes ()
 
const edit_scriptmember_types_changes () const
 
const changed_var_sptrs_typeordered_data_members_replaced_by_adms () const
 Get an ordered vector of of data members that got replaced by anonymous data members.
 
virtual void report (ostream &, const string &indent="") const
 Report the changes carried by the current class_or_union_diff node in a textual format.
 
class_or_union_sptr second_class_or_union () const
 
const var_diff_sptrs_typesorted_changed_data_members () const
 Getter of the sorted vector of data members that got replaced by another data member.
 
const var_diff_sptrs_typesorted_subtype_changed_data_members () const
 Getter of the sorted vector of data members with a (sub-)type change.
 
- Public Member Functions inherited from type_diff_base
- Public Member Functions inherited from diff
diff_category add_to_category (diff_category c)
 Adds the current diff tree node to an additional set of categories. Note that the categories include thoses inherited from the children nodes of this diff node.
 
void add_to_local_and_inherited_categories (diff_category c)
 Adds the current diff tree node to the categories resulting from the local and inherited changes of the current diff node.
 
diff_category add_to_local_category (diff_category c)
 Adds the current diff tree node to the categories resulting from the local changes of the current diff node.
 
void append_child_node (diff_sptr)
 Add a new child node to the vector of children nodes for the current diff node.
 
const vector< diff * > & children_nodes () const
 Getter for the children nodes of the current diff node.
 
const diff_context_sptr context () const
 Getter of the context of the current diff.
 
void context (diff_context_sptr c)
 Setter of the context of the current diff.
 
bool currently_reporting () const
 Tests if we are currently in the middle of emitting a report for this diff.
 
void currently_reporting (bool f) const
 Sets a flag saying if we are currently in the middle of emitting a report for this diff.
 
type_or_decl_base_sptr first_subject () const
 Getter of the first subject of the diff.
 
diffget_canonical_diff () const
 Getter for the canonical diff of the current instance of diff.
 
diff_category get_category () const
 Getter for the category of the current diff tree node.
 
diff_category get_class_of_equiv_category () const
 Getter of the category of the class of equivalence of the current diff tree node.
 
diff_category get_local_category () const
 Getter for the local category of the current diff tree node.
 
virtual const string & get_pretty_representation () const
 Get a pretty representation of the current diff node.
 
bool has_descendant_allowed_by_specific_negated_suppression () const
 Test if the current diff node has a descendant node which is specifically allowed by a negated suppression specification.
 
bool has_local_changes_to_be_reported () const
 Test if this diff tree node should be reported when considering the categories that were *NOT* inherited from its children nodes.
 
bool has_parent_allowed_by_specific_negated_suppression () const
 Test if the current diff node has a parent node which is specifically allowed by a negated suppression specification.
 
bool is_allowed_by_specific_negated_suppression () const
 Test if this diff node is allowed (prevented from being suppressed) by at least one negated suppression specification.
 
bool is_filtered_out () const
 Test if this diff tree node is to be filtered out for reporting purposes.
 
bool is_filtered_out_without_looking_at_allowed_changes () const
 Test if this diff tree node is to be filtered out for reporting purposes, but without considering the categories that can /force/ the node to be unfiltered.
 
bool is_filtered_out_wrt_non_inherited_categories () const
 Test if this diff tree node is to be filtered out for reporting purposes, but by considering only the categories that were *NOT* inherited from its children nodes.
 
bool is_suppressed () const
 Test if the current diff node has been suppressed by a user-provided suppression specification.
 
bool is_suppressed (bool &is_private_type) const
 Test if the current diff node has been suppressed by a user-provided suppression specification or by an auto-generated "private type" suppression specification.
 
bool is_traversing () const
 Tell if a given node is being traversed or not.
 
const diffparent_node () const
 Getter for the parent node of the current diff node.
 
diff_category remove_from_category (diff_category c)
 Remove the current diff tree node from an a existing sef of categories. The categories include those inherited from the children nodes of the current diff node.
 
diff_category remove_from_local_category (diff_category c)
 Remove the current diff tree node from the categories resulting from the local changes.
 
bool reported_once () const
 Tests if a report has already been emitted for the current diff.
 
void reported_once (bool f) const
 Sets a flag saying if a report has already been emitted for the current diff.
 
type_or_decl_base_sptr second_subject () const
 Getter of the second subject of the diff.
 
void set_category (diff_category c)
 Set the category of the current diff node. This category includes the categories inherited from the children nodes of the current diff node.
 
void set_local_category (diff_category c)
 Set the local category of the current diff node.
 
bool to_be_reported () const
 Test if this diff tree node should be reported.
 
virtual bool traverse (diff_node_visitor &v)
 The generic traversing code that walks a given diff sub-tree.
 
- Public Member Functions inherited from diff_traversable_base
- Public Member Functions inherited from traversable_base
virtual ~traversable_base ()
 Destructor of the traversable_base type.
 

Protected Types

typedef std::unique_ptr< privpriv_ptr
 

Protected Member Functions

 class_or_union_diff (class_or_union_sptr first_scope, class_or_union_sptr second_scope, diff_context_sptr ctxt=diff_context_sptr())
 Constructor for the class_or_union_diff class.
 
void allocate_priv_data ()
 Allocate the memory for the priv_ pimpl data member of the class_or_union_diff class.
 
void clear_lookup_tables (void)
 Clear the lookup tables useful for reporting.
 
void ensure_lookup_tables_populated (void) const
 If the lookup tables are not yet built, walk the differences and fill them.
 
bool lookup_tables_empty (void) const
 Tests if the lookup tables are empty.
 
- Protected Member Functions inherited from type_diff_base
 type_diff_base (type_base_sptr first_subject, type_base_sptr second_subject, diff_context_sptr ctxt)
 
- Protected Member Functions inherited from diff
 diff (type_or_decl_base_sptr first_subject, type_or_decl_base_sptr second_subject)
 Constructor for the diff type.
 
 diff (type_or_decl_base_sptr first_subject, type_or_decl_base_sptr second_subject, diff_context_sptr ctxt)
 Constructor for the diff type.
 
void begin_traversing ()
 Flag a given diff node as being traversed.
 
bool do_log () const
 Test if logging was requested.
 
void do_log (bool)
 Request logging (or not)
 
void end_traversing ()
 Flag a given diff node as not being traversed anymore.
 
virtual void finish_diff_type ()
 Finish the insertion of a diff tree node into the diff graph.
 
void set_canonical_diff (diff *)
 Setter for the canonical diff of the current instance of diff.
 
- Protected Member Functions inherited from traversable_base
 traversable_base ()
 Default constructor of the traversable_base type.
 
bool visiting () const
 This should returns false before and after the node has been visiting. During the visiting of the node (and of its children) this should return true.
 
void visiting (bool f)
 The traversing code should be responsible of calling this, not the user code.
 

Protected Attributes

priv_ptr priv_
 
- Protected Attributes inherited from diff
std::unique_ptr< priv > priv_
 

Friends

class default_reporter
 

Detailed Description

This is the base class of class_diff and union_diff.

Definition at line 1736 of file abg-comparison.h.

Member Typedef Documentation

◆ priv_ptr

std::unique_ptr<priv> priv_ptr
protected

Definition at line 1740 of file abg-comparison.h.

Constructor & Destructor Documentation

◆ class_or_union_diff()

class_or_union_diff ( class_or_union_sptr first_scope,
class_or_union_sptr second_scope,
diff_context_sptr ctxt = diff_context_sptr() )
protected

Constructor for the class_or_union_diff class.

Parameters
first_scopethe first class_or_union of the diff node.
second_scopethe second class_or_union of the diff node.
ctxtthe context of the diff.

Definition at line 5592 of file abg-comparison.cc.

◆ ~class_or_union_diff()

~class_or_union_diff ( )
virtual

Destructor of class_or_union_diff.

Definition at line 5628 of file abg-comparison.cc.

Member Function Documentation

◆ allocate_priv_data()

void allocate_priv_data ( )
protected

Allocate the memory for the priv_ pimpl data member of the class_or_union_diff class.

Definition at line 5579 of file abg-comparison.cc.

◆ chain_into_hierarchy()

void chain_into_hierarchy ( )
virtual

Populate the vector of children node of the diff base type sub-object of this instance of class_or_union_diff.

The children node can then later be retrieved using diff::children_node().

Reimplemented from diff.

Reimplemented in class_diff.

Definition at line 5852 of file abg-comparison.cc.

◆ changed_data_members()

const unsigned_var_diff_sptr_map & changed_data_members ( ) const

Getter of the map of data members that got replaced by another data member. The key of the map is the offset at which the element got replaced and the value is a pointer to the var_diff representing the replacement of the data member.

Returns
sorted vector of changed data member.

Definition at line 5718 of file abg-comparison.cc.

◆ changed_member_fns()

const function_decl_diff_sptrs_type & changed_member_fns ( ) const

Getter for the virtual members functions that have had a change in a sub-type, without having a change in their symbol name.

Returns
a sorted vector of virtual member functions that have a sub-type change.

Definition at line 5692 of file abg-comparison.cc.

◆ clear_lookup_tables()

void clear_lookup_tables ( void )
protected

Clear the lookup tables useful for reporting.

This function must be updated each time a lookup table is added or removed from the class_or_union_diff::priv.

Definition at line 5119 of file abg-comparison.cc.

◆ count_filtered_changed_data_members()

size_t count_filtered_changed_data_members ( bool local = false) const

Count the number of /filtered/ data members that got replaced by another data member.

Returns
the number of changed data member that got filtered out.

Definition at line 5734 of file abg-comparison.cc.

◆ count_filtered_subtype_changed_data_members()

size_t count_filtered_subtype_changed_data_members ( bool local = false) const

Count the number of /filtered/ data members with a sub-type change.

Returns
the number of changed data member that got filtered out.

Definition at line 5748 of file abg-comparison.cc.

◆ data_members_changes() [1/2]

edit_script & data_members_changes ( )
Returns
the edit script of the data members of the two class_or_union.

Definition at line 5663 of file abg-comparison.cc.

◆ data_members_changes() [2/2]

const edit_script & data_members_changes ( ) const
Returns
the edit script of the data members of the two class_or_union.

Definition at line 5657 of file abg-comparison.cc.

◆ data_members_replaced_by_adms()

const string_decl_base_sptr_map & data_members_replaced_by_adms ( ) const

Get the map of data members that got replaced by anonymous data members.

The key of a map entry is the name of the replaced data member and the value is the anonymous data member that replaces it.

Returns
the map of data members replaced by anonymous data members.

Definition at line 5760 of file abg-comparison.cc.

◆ deleted_data_members()

const string_decl_base_sptr_map & deleted_data_members ( ) const

Getter for the data members that got deleted.

Returns
a map of data members that got deleted.

Definition at line 5677 of file abg-comparison.cc.

◆ deleted_member_fns()

const string_member_function_sptr_map & deleted_member_fns ( ) const
Returns
a map of member functions that got deleted.

Definition at line 5703 of file abg-comparison.cc.

◆ ensure_lookup_tables_populated()

void ensure_lookup_tables_populated ( void ) const
protected

If the lookup tables are not yet built, walk the differences and fill them.

Definition at line 5158 of file abg-comparison.cc.

◆ first_class_or_union()

class_or_union_sptr first_class_or_union ( ) const
Returns
the first class_or_union involved in the diff.

Definition at line 5634 of file abg-comparison.cc.

◆ get_priv()

const class_or_union_diff::priv_ptr & get_priv ( ) const

Getter of the private data of the class_or_union_diff type.

Note that due to an optimization, the private data of class_or_union_diff can be shared among several instances of class_or_union_diff, so you should never try to access class_or_union_diff::priv directly.

When class_or_union_diff::priv is shared, this function returns the correct shared one.

Returns
the (possibly) shared private data of the current instance of class_or_union_diff.

Definition at line 5612 of file abg-comparison.cc.

◆ has_changes()

bool has_changes ( ) const
virtual

Test if the current diff node carries a change.

Implements diff.

Reimplemented in class_diff.

Definition at line 5818 of file abg-comparison.cc.

◆ has_local_changes()

enum change_kind has_local_changes ( ) const
virtual
Returns
the kind of local change carried by the current diff node. The value returned is zero if the current node carries no local change.

Implements type_diff_base.

Reimplemented in class_diff.

Definition at line 5825 of file abg-comparison.cc.

◆ inserted_data_members()

const string_decl_base_sptr_map & inserted_data_members ( ) const

Getter for the data members that got inserted.

Returns
a map of data members that got inserted.

Definition at line 5670 of file abg-comparison.cc.

◆ inserted_member_fns()

const string_member_function_sptr_map & inserted_member_fns ( ) const
Returns
a map of member functions that got inserted.

Definition at line 5708 of file abg-comparison.cc.

◆ lookup_tables_empty()

bool lookup_tables_empty ( void ) const
protected

Tests if the lookup tables are empty.

Returns
true if the lookup tables are empty, false otherwise.

Definition at line 5139 of file abg-comparison.cc.

◆ member_class_tmpls_changes() [1/2]

edit_script & member_class_tmpls_changes ( )
Returns
the edit script of the member class templates of the two class_or_union.

Definition at line 5813 of file abg-comparison.cc.

◆ member_class_tmpls_changes() [2/2]

const edit_script & member_class_tmpls_changes ( ) const
Returns
the edit script of the member class templates of the two class_or_union.

Definition at line 5807 of file abg-comparison.cc.

◆ member_fn_tmpls_changes() [1/2]

edit_script & member_fn_tmpls_changes ( )
Returns
the edit script of the member function templates of the two class_or_union.

Definition at line 5801 of file abg-comparison.cc.

◆ member_fn_tmpls_changes() [2/2]

const edit_script & member_fn_tmpls_changes ( ) const
Returns
the edit script of the member function templates of the two class_or_union.

Definition at line 5795 of file abg-comparison.cc.

◆ member_fns_changes() [1/2]

edit_script & member_fns_changes ( )
Returns
the edit script of the member functions of the two classes.

Definition at line 5698 of file abg-comparison.cc.

◆ member_fns_changes() [2/2]

const edit_script & member_fns_changes ( ) const
Returns
the edit script of the member functions of the two class_or_union.

Definition at line 5683 of file abg-comparison.cc.

◆ member_types_changes() [1/2]

edit_script & member_types_changes ( )
Returns
the edit script of the member types of the two class_or_union.

Definition at line 5651 of file abg-comparison.cc.

◆ member_types_changes() [2/2]

const edit_script & member_types_changes ( ) const
Returns
the edit script of the member types of the two class_or_union.

Definition at line 5645 of file abg-comparison.cc.

◆ ordered_data_members_replaced_by_adms()

const changed_var_sptrs_type & ordered_data_members_replaced_by_adms ( ) const

Get an ordered vector of of data members that got replaced by anonymous data members.

This returns a vector of pair of two data members: the one that was replaced, and the anonymous data member that replaced it.

Returns
the sorted vector data members replaced by anonymous data members.

Definition at line 5771 of file abg-comparison.cc.

◆ report()

void report ( ostream & out,
const string & indent = "" ) const
virtual

Report the changes carried by the current class_or_union_diff node in a textual format.

Parameters
outthe output stream to write the textual report to.
indentthe number of white space to use as indentation.

Implements diff.

Reimplemented in class_diff, and union_diff.

Definition at line 5841 of file abg-comparison.cc.

◆ second_class_or_union()

class_or_union_sptr second_class_or_union ( ) const
Returns
the second class_or_union involved in the diff.

Definition at line 5639 of file abg-comparison.cc.

◆ sorted_changed_data_members()

const var_diff_sptrs_type & sorted_changed_data_members ( ) const

Getter of the sorted vector of data members that got replaced by another data member.

Returns
sorted vector of changed data member.

Definition at line 5726 of file abg-comparison.cc.

◆ sorted_subtype_changed_data_members()

const var_diff_sptrs_type & sorted_subtype_changed_data_members ( ) const

Getter of the sorted vector of data members with a (sub-)type change.

Returns
sorted vector of changed data member.

Definition at line 5741 of file abg-comparison.cc.

Friends And Related Symbol Documentation

◆ default_reporter

friend class default_reporter
friend

Definition at line 1853 of file abg-comparison.h.

Member Data Documentation

◆ priv_

priv_ptr priv_
protected

Definition at line 1741 of file abg-comparison.h.


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