diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-10-27 19:25:50 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-10-27 19:25:50 +0100 |
commit | 867823f4429b1215cd5c3aa6d2415fb324429891 (patch) | |
tree | 2915f6c2e0acae69ad2b738e0038766354d60856 /src/include/tome/squelch/cursor.hpp | |
parent | f005efee43bdb2e9749b02f73b876bf2c1145f1b (diff) | |
parent | 47fb7807d77c92fa6e72017501d9355d780adf40 (diff) |
Merge branch 'cpp'
Diffstat (limited to 'src/include/tome/squelch/cursor.hpp')
-rw-r--r-- | src/include/tome/squelch/cursor.hpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/include/tome/squelch/cursor.hpp b/src/include/tome/squelch/cursor.hpp new file mode 100644 index 00000000..8dbfc6bf --- /dev/null +++ b/src/include/tome/squelch/cursor.hpp @@ -0,0 +1,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 |