summaryrefslogtreecommitdiff
path: root/src/include/tome/squelch/cursor.hpp
blob: 8dbfc6bffcd757050dbdcadc750863fce7db8040 (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
#ifndef H_8a10111d_64a1_4af9_a85b_24ec8922d3fa
#define H_8a10111d_64a1_4af9_a85b_24ec8922d3fa

#include <boost/noncopyable.hpp>
#include <deque>

#include "tome/squelch/condition_fwd.hpp"

namespace squelch {

/**
 * Cursor which maintains selected condition(s)
 */
class Cursor : public boost::noncopyable
{
public:
	bool is_selected(Condition const *condition) const;

	void push(Condition *condition) {
		m_conditions.push_back(condition);
	}

	Condition *pop();

	Condition *current();

	void clear() {
		m_conditions.clear();
	}

	bool empty() const {
		return m_conditions.empty();
	}

	std::size_t size() const {
		return m_conditions.size();
	}

	void move_left();
	void move_right();
	void move_up();
	void move_down();

private:
	std::deque<Condition *> m_conditions;
};

} // namespace

#endif