monotone

monotone Mtn Source Tree

Root/src/rev_types.hh

1// Copyright (C) 2007 Zack Weinberg <zackw@panix.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10#ifndef __REV_TYPES_HH__
11#define __REV_TYPES_HH__
12
13// This file contains forward declarations and typedefs for all of the basic
14// types associated with revision handling. It should be included instead
15// of (any or all of) basic_io.hh, cset.hh, graph.hh, paths.hh, revision.hh,
16// roster.hh, and database.hh when all that is necessary is these
17// declarations.
18
19#include <boost/shared_ptr.hpp>
20#include "vocab.hh"
21#include "numeric_vocab.hh"
22#include "hybrid_map.hh"
23#include "vector.hh"
24#include "cow_trie.hh"
25
26// full definitions in basic_io.hh
27namespace basic_io
28{
29 struct printer;
30 struct parser;
31 struct stanza;
32}
33
34// full definitions in cset.hh
35typedef u32 node_id;
36struct cset;
37struct editable_tree;
38
39const node_id first_temp_node = 1U << (sizeof(node_id) * 8 - 1);
40inline bool temp_node(node_id n)
41{
42 return n & first_temp_node;
43}
44
45// full definitions in graph.hh
46struct rev_graph;
47struct reconstruction_graph;
48typedef std::vector<id> reconstruction_path;
49typedef std::multimap<revision_id, revision_id> rev_ancestry_map;
50
51// full definitions in paths.hh
52class any_path;
53class bookkeeping_path;
54class file_path;
55class system_path;
56class path_component;
57
58// full definitions in revision.hh
59struct revision_t;
60typedef std::map<revision_id, boost::shared_ptr<cset> > edge_map;
61typedef edge_map::value_type edge_entry;
62
63// full definitions in rev_height.hh
64class rev_height;
65
66// full definitions in roster.hh
67struct node_id_source;
68struct node;
69struct dir_node;
70struct file_node;
71struct marking;
72class roster_t;
73class editable_roster_base;
74
75typedef boost::shared_ptr<node> node_t;
76typedef boost::shared_ptr<file_node> file_t;
77typedef boost::shared_ptr<dir_node> dir_t;
78
79typedef boost::shared_ptr<node const> const_node_t;
80typedef boost::shared_ptr<file_node const> const_file_t;
81typedef boost::shared_ptr<dir_node const> const_dir_t;
82
83typedef boost::shared_ptr<marking> marking_t;
84typedef boost::shared_ptr<marking const> const_marking_t;
85class marking_map;
86
87typedef std::map<path_component, node_t> dir_map;
88//typedef hybrid_map<node_id, node_t> node_map;
89typedef cow_trie<node_id, node_t, 8> node_map;
90
91// (true, "val") or (false, "") are both valid attr values (for proper
92// merging, we have to widen the attr_value type to include a first-class
93// "undefined" value).
94typedef std::map<attr_key, std::pair<bool, attr_value> > attr_map_t;
95
96// full definitions in database.hh
97class database;
98class conditional_transaction_guard;
99class transaction_guard;
100
101typedef boost::shared_ptr<roster_t const> roster_t_cp;
102typedef boost::shared_ptr<marking_map const> marking_map_cp;
103typedef std::pair<roster_t_cp, marking_map_cp> cached_roster;
104
105typedef std::map<revision_id, cached_roster> parent_map;
106typedef parent_map::value_type parent_entry;
107
108#endif // __REV_TYPES_HH__
109
110// Local Variables:
111// mode: C++
112// fill-column: 76
113// c-file-style: "gnu"
114// indent-tabs-mode: nil
115// End:
116// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

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