/usr/include/libabigail/abg-traverse.h is in libabigail-dev 1.0~rc6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | // -*- mode: C++ -*-
//
// Copyright (C) 2013-2015 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/>.
/// @file
#ifndef __ABG_TRAVERSE_H__
#define __ABG_TRAVERSE_H__
#include "abg-fwd.h"
namespace abigail
{
namespace ir
{
/// The base class for the visitor type hierarchy used for traversing
/// a hierarchy of nodes.
///
/// Client code willing to get notified for a certain kind of node
/// during traversal might want to define a visitor class that inherit
/// \a node_visitor, define and overload a node_visitor::visit method
/// for it, like what is done for the ir_node_visitor::visit set of
/// functions, for traversing internal representation nodes.
struct node_visitor_base
{};
/// The interface for types which are feeling social and want to be
/// visited during the traversal of a hierarchy of nodes.
class traversable_base
{
bool visiting_;
protected:
/// 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.
///
/// @return true if the current node is being visited.
bool
visiting()
{return visiting_;}
/// The traversing code should be responsible of calling this, not
/// the user code.
///
/// This is the setter of the "visiting" flag of the node being
/// visited. If set to yes, it means the node is being visited.
/// False means either the node has not yet been visited, or it
/// has already been visited.
///
/// @param f the new value of the "visiting" flag.
void
visiting(bool f)
{visiting_ = f;}
public:
traversable_base()
: visiting_()
{}
/// This virtual method is overloaded and implemented by any single
/// type which instance is going to be visited during the traversal
/// of translation unit nodes.
///
/// The method visits a given node and, for scopes, visits their
/// member nodes. Visiting a node means calling the
/// ir_node_visitor::visit method with the node passed as an
/// argument.
///
/// @param v the visitor used during the traverse.
///
/// @return true if traversed until the end of the type tree, false
/// otherwise.
virtual bool traverse(node_visitor_base& v);
};
}// end namespace ir.
}//end namespace abigail
#endif //__ABG_TRAVERSE_H__
|