-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPSEngineBase.hpp
More file actions
51 lines (42 loc) · 1.66 KB
/
MPSEngineBase.hpp
File metadata and controls
51 lines (42 loc) · 1.66 KB
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
/*
* This file is part of MemphisNow.
*
* MemphisNow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MemphisNow is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MemphisNow. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MPSENGINEBASE_HPP
#define MPSENGINEBASE_HPP
#include <MPSToken.hpp>
#include <queue>
/*
* This class decouples the MPSCondition* and MPSAction* classes from the actual MPSEngine.
* They end up having access to exactly what they need from the MPSEngine instead of the whole functionality
*/
class MPSEngineBase
{
public:
virtual ~MPSEngineBase() = 0;
virtual void update (MPSToken* token) = 0;
// this is public from the engine base, but becomes private in the actual engine, intended
virtual void change_case (MPSToken* token, bool upcase, bool only_first, bool recursive) = 0;
virtual bool is_token_current_root(const MPSToken* token) const = 0;
// error handling
void push_message (const std::wstring& msg);
bool has_messages () const;
std::wstring pop_message ();
void clear_messages ();
protected:
// store status & error messages until they are processed
mutable std::queue<std::wstring> m_messages;
};
#endif // MPSENGINEBASE_HPP