monotone

monotone Mtn Source Tree

Root/graph.hh

1#ifndef __GRAPH__HH__
2
3// Copyright (C) 2006 Nathaniel Smith <njs@pobox.com>
4//
5// This program is made available under the GNU GPL version 2.0 or
6// greater. See the accompanying file COPYING for details.
7//
8// This program is distributed WITHOUT ANY WARRANTY; without even the
9// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10// PURPOSE.
11
12// This file contains generic graph algorithms. They are split out from any
13// particular concrete graph (e.g., the revision graph, the delta storage
14// graphs) to easy re-use, and to make them easier to test on their own. We
15// have a number of graph algorithms that are not genericized in this way
16// (e.g., in revision.cc); FIXME it would be good to move them in here as
17// opportunity permits.
18
19#include <string>
20#include <set>
21#include <vector>
22
23struct reconstruction_graph
24{
25 virtual bool is_base(std::string const & node) const = 0;
26 virtual void get_next(std::string const & from, std::set<std::string> & next) const = 0;
27 virtual ~reconstruction_graph() {};
28};
29
30typedef std::vector<std::string> reconstruction_path;
31
32void
33get_reconstruction_path(std::string const & start,
34 reconstruction_graph const & graph,
35 reconstruction_path & path);
36
37#endif // __GRAPH__HH__
38
39
40// Local Variables:
41// mode: C++
42// fill-column: 76
43// c-file-style: "gnu"
44// indent-tabs-mode: nil
45// End:
46// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
47

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status