 |
wxMaxima
|
Go to the documentation of this file.
32 #ifndef EVALUATIONQUEUE_H
33 #define EVALUATIONQUEUE_H
37 #include <wx/arrstr.h>
47 Command(
const wxString &
string,
int index) : m_indexStart(index), m_command(
string) {}
48 Command(Command &&o) : m_indexStart(o.m_indexStart), m_command(std::move(o.m_command)) {}
49 Command(
const Command &o) : m_indexStart(o.m_indexStart), m_command(o.m_command) {}
50 Command &operator=(Command &&o)
52 m_indexStart = o.m_indexStart;
53 m_command = std::move(o.m_command);
56 Command &operator=(
const Command &o)
58 m_indexStart = o.m_indexStart;
59 m_command = o.m_command;
63 const wxString &GetString()
const {
return m_command; }
64 void AddEnding() { m_command +=
";"; }
65 int GetIndex()
const {
return m_indexStart; }
78 std::vector<EvaluationQueue::Command> m_commands;
83 std::vector<GroupCell *> m_queue;
89 wxArrayString m_knownAnswers;
90 wxArrayString m_knownQuestions;
100 {
return m_userLabel; }
104 if (!m_commands.empty())
105 return m_commands.front().GetIndex();
110 bool m_workingGroupChanged;
116 if (!m_commands.empty())
117 m_commands.back().AddEnding();
126 return !m_queue.empty() && (gr == m_queue.front());
160 int Size()
const {
return m_size; }
bool Empty() const
Is the queue empty?
Definition: EvaluationQueue.cpp:33
void RemoveFirst()
Removes the first command in the queue.
Definition: EvaluationQueue.cpp:104
void AddToQueue(GroupCell *gr)
Adds a GroupCell to the evaluation queue.
Definition: EvaluationQueue.cpp:71
A simple FIFO queue with manual removal of elements.
Definition: EvaluationQueue.h:41
wxString GetCommand()
Return the next command that needs to be evaluated.
Definition: EvaluationQueue.cpp:175
int Size() const
Get the size of the queue [in cells].
Definition: EvaluationQueue.h:160
void Clear()
Clear the queue.
Definition: EvaluationQueue.cpp:44
wxString GetUserLabel() const
Definition: EvaluationQueue.h:99
int CommandsLeftInCell() const
Get the size of the queue.
Definition: EvaluationQueue.h:163
GroupCell * GetCell()
Definition: EvaluationQueue.cpp:167
bool IsLastInQueue(GroupCell const *gr)
Is GroupCell gr part of the evaluation queue?
Definition: EvaluationQueue.h:124
void AddHiddenTreeToQueue(GroupCell *gr)
Adds all hidden cells attached to the GroupCell gr to the evaluation queue.
Definition: EvaluationQueue.cpp:92
void Remove(GroupCell *gr)
Remove a GroupCell from the evaluation queue.
Definition: EvaluationQueue.cpp:57
Definition: GroupCell.h:68
bool IsInQueue(GroupCell *gr) const
Is GroupCell gr part of the evaluation queue?
Definition: EvaluationQueue.cpp:52