aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm
blob: 82913adef0f285e0a830ce82fbe2ce445fcf808b (plain)
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
// file      : build/algorithm -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license   : MIT; see accompanying LICENSE file

#ifndef BUILD_ALGORITHM
#define BUILD_ALGORITHM

#include <build/target>
#include <build/timestamp>

namespace build
{
  class prerequisite;

  // The default prerequsite search implementation. It first calls the
  // target-type-specific search function. If that doesn't yeld anything,
  // it creates a new target.
  //
  target&
  search (prerequisite&);

  // Match a rule to the target with ambiguity detection.
  //
  void
  match (target&);

  // The default prerequisite search and match implementation. It calls
  // search() and then match() for each prerequisite in a loop.
  //
  void
  search_and_match (target&);

  target_state
  update (target&);

  // The default prerequisite update implementation. It calls update()
  // for each prerequisite in a loop. Returns target_state::updated
  // if any of them were updated and target_state::uptodate otherwise.
  //
  target_state
  update_prerequisites (target&);

  // A version of the above that also determines whether the target
  // needs updating based on the passed timestamp.
  //
  bool
  update_prerequisites (target&, const timestamp&);

  // Another version of the above that does two extra things for the
  // caller: it determines whether the target needs updating based
  // on the passed timestamp and, if so, finds a prerequisite of the
  // specified type.
  //
  template <typename T>
  T*
  update_prerequisites (target&, const timestamp&);
}

#include <build/algorithm.ixx>
#include <build/algorithm.txx>

#endif // BUILD_ALGORITHM