moveStack.cc
Go to the documentation of this file.
2 #include "osl/csa.h"
3 #include <iostream>
4 
6 {
7  data.reserve(16);
8  clear();
9 }
10 
12 {
13 }
14 
15 void osl::MoveStack::reserve(size_t capacity)
16 {
17  data.reserve(capacity);
18 }
19 
21 {
22  data.clear();
23  data.push_back(Move::INVALID());
24  data.push_back(Move::INVALID());
25 }
26 
27 #ifndef MINIMAL
28 void osl::MoveStack::dump(std::ostream& os, size_t last_n) const
29 {
30  const size_t start = (last_n == 0) ? 0 : size() - last_n;
31  os << "move stack";
32  vector_t::const_iterator p=data.begin();
33  ++p; // skip first element, pass
34  for (size_t i=0; p!=data.end(); ++p, ++i)
35  {
36  if (i < start)
37  continue;
38  os << " " << csa::show(*p);
39  }
40  os << "\n";
41 }
42 
43 void osl::MoveStack::dump(size_t last_n) const
44 {
45  dump(std::cerr, last_n);
46 }
47 #endif
48 // ;;; Local Variables:
49 // ;;; mode:c++
50 // ;;; c-basic-offset:2
51 // ;;; End:
void dump(size_t last_n=0) const
Definition: moveStack.cc:43
static const Move INVALID()
Definition: basic_type.h:1095
size_t size() const
Definition: moveStack.h:34
const std::string show(Move)
Definition: csa.cc:133