libabigail/include/abg-comparison.h
Dodji Seketeli 9b89a16a8b Change the diff::changes_type back to just edit_script
* include/abg-comparison.h (diff::changes_type):
	Remove this typedef.
	(class_decl_diff::data_members_changes): Rename
	class_decl_diff::data_member_changes into this.
	(class_decl_diff::member_fn_tmpls_changes): Renamed
	class_decl_diff::member_fn_tmpl_changes into this.
	(class_decl_diff::member_class_tmpls_changes): Renamed
	class_decl_diff::member_class_tmpl_changes into this.
	(class_decl_diff::{base_changes, member_types_changes,
	data_members_changes, member_fns_changes, member_fn_tmpls_changes,
	member_fn_tmpls_changes, member_class_tmpls_changes}): Adjust
	these declarations for the use of edit_script.
	* src/abg-comparison.cc (class_decl_diff::priv::*): Likewise.
	(class_decl_diff::{base_changes, member_types_changes,
	data_members_changes, member_fns_changes, member_fn_tmpls_changes,
	member_fn_tmpls_changes, member_class_tmpls_changes}): Adjust
	these definitions for the above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:21:11 +01:00

113 lines
2.5 KiB
C++

// -*- Mode: C++ -*-
//
// Copyright (C) 2013 Red Hat, Inc.
//
// This file is part of the GNU Application Binary Interface Generic
// Analysis and Instrumentation Library (libabigail). This library is
// free software; you can redistribute it and/or modify it under the
// terms of the GNU Lesser General Public License as published by the
// Free Software Foundation; either version 3, or (at your option) any
// later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this program; see the file COPYING-LGPLV3. If
// not, see <http://www.gnu.org/licenses/>.
//
// Author: Dodji Seketeli
/// @file
#include "abg-ir.h"
#include "abg-diff-utils.h"
namespace abigail
{
namespace comparison
{
// Injecting lower-level types from diff_utils into this namespace.
using diff_utils::insertion;
using diff_utils::deletion;
using diff_utils::edit_script;
/// This type encapsulates an edit script (a set of insertions and
/// deletions) for a given scope. It's the base class to represents
/// changes that appertain to a certain kind of construct.
class diff
{
shared_ptr<scope_decl> scope_;
public:
diff(shared_ptr<scope_decl> scope)
: scope_(scope)
{}
shared_ptr<scope_decl>
scope() const
{return scope_;}
};// end class diff
/// This type abstracts changes for a class_decl.
class class_decl_diff : public diff
{
struct priv;
shared_ptr<priv> priv_;
public:
class_decl_diff(shared_ptr<scope_decl> scope);
const edit_script&
base_changes() const;
edit_script&
base_changes();
const edit_script&
member_types_changes() const;
edit_script&
member_types_changes();
const edit_script&
data_members_changes() const;
edit_script&
data_members_changes();
const edit_script&
member_fns_changes() const;
edit_script&
member_fns_changes();
const edit_script&
member_fn_tmpls_changes() const;
edit_script&
member_fn_tmpls_changes();
const edit_script&
member_class_tmpls_changes() const;
edit_script&
member_class_tmpls_changes();
};// end class_decl_edit_script
void
compute_diff(class_decl_sptr first,
class_decl_sptr second,
class_decl_diff &changes);
}// end namespace comparison
}// end namespace abigail