/usr/include/gamera/graph/node.hpp is in python-gamera-dev 3.4.2+svn1437-2.
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 | /*
*
* Copyright (C) 2011 Christian Brandt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _NODE_HPP_6F6639BC0A8223
#define _NODE_HPP_6F6639BC0A8223
#include "graph_common.hpp"
#include "edgenodeiterator.hpp"
namespace Gamera { namespace GraphApi {
struct Node {
EdgeVector _edges; /// < edges pointing in/out this node
GraphData * _value; /// < nodes's value
Graph* _graph;
Node(GraphData * value, Graph* graph = NULL);
~Node();
Node(Node& node);
Node(Node* node);
void add_to_graph(Graph* graph) {
_graph = graph;
}
void remove_from_graph() {
if(_graph != NULL) {
_graph = NULL;
}
}
/// compares this value with given node's value
bool operator==(Node& n) {
return *_value == *n._value;
}
/// compares this value with given value
bool operator==(GraphData * v) {
return *_value == *v;
}
/** Iterator over edges pointing in/out this node
* @param both_directions false: only edges pointing out this node
* true: edges pointing in and out this node
**/
EdgePtrIterator* get_edges(bool both_directions = false);
/// Iterator over all nodes reachable from this node
NodePtrEdgeIterator* get_nodes();
size_t get_nedges() { return _edges.size() ; }
size_t get_nnodes() {
NodePtrEdgeIterator* it = get_nodes();
size_t count = 0;
while(it->next() != NULL)
count++;
delete it;
return count;
}
bool has_edge_to(Node* node);
bool has_edge_from(Node* node);
void add_edge(Edge* edge);
void remove_edge(Edge* edge);
/** removes node from graph
* @param glue true if neighbor-edges should be glued together
* */
void remove_self(bool glue=false);
};
}} // end Gamera::GraphApi
#endif /* _NODE_HPP_6F6639BC0A8223 */
|