My Project
std
osl
container
moveStack.cc
Go to the documentation of this file.
1
#include "
osl/container/moveStack.h
"
2
#include "
osl/csa.h
"
3
#include <iostream>
4
5
osl::MoveStack::MoveStack
()
6
{
7
data
.reserve(16);
8
clear
();
9
}
10
11
osl::MoveStack::~MoveStack
()
12
{
13
}
14
15
void
osl::MoveStack::reserve
(
size_t
capacity)
16
{
17
data.reserve(capacity);
18
}
19
20
void
osl::MoveStack::clear
()
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:
osl::Move::INVALID
static const Move INVALID()
Definition
basic_type.h:1095
osl::container::MoveStack::clear
void clear()
Definition
moveStack.cc:20
osl::container::MoveStack::~MoveStack
~MoveStack()
Definition
moveStack.cc:11
osl::container::MoveStack::MoveStack
MoveStack()
Definition
moveStack.cc:5
osl::container::MoveStack::reserve
void reserve(size_t)
Definition
moveStack.cc:15
osl::container::MoveStack::dump
void dump(size_t last_n=0) const
Definition
moveStack.cc:43
osl::container::MoveStack::data
vector_t data
Definition
moveStack.h:17
csa.h
moveStack.h
osl::csa::show
const std::string show(Move)
Definition
csa.cc:133
Generated by
1.9.8