wxMaxima
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Static Public Member Functions | Data Fields
EvaluationQueue Class Reference

A simple FIFO queue with manual removal of elements. More...

#include <EvaluationQueue.h>

Public Member Functions

wxString GetUserLabel () const
 Query for the label the user has assigned to the current command.
 
int GetIndex () const
 
long GetCommandStart () const
 
void AddEnding ()
 
bool IsLastInQueue (GroupCell const *gr)
 Is GroupCell gr part of the evaluation queue?
 
bool IsInQueue (GroupCell *gr) const
 Is GroupCell gr part of the evaluation queue?
 
void AddToQueue (GroupCell *gr)
 Adds a GroupCell to the evaluation queue.
 
void Remove (GroupCell *gr)
 Remove a GroupCell from the evaluation queue.
 
void AddHiddenTreeToQueue (const GroupCell *gr)
 Adds all hidden cells attached to the GroupCell gr to the evaluation queue.
 
void RemoveFirst ()
 Removes the first command in the queue.
 
GroupCell * GetCell ()
 Gets the cell the next command in the queue belongs to.
 
bool Empty () const
 Is the queue empty?
 
void Clear ()
 Clear the queue.
 
wxString GetCommand ()
 Return the next command that needs to be evaluated.
 
bool HasIntegrityFailure () const
 Did the cell that just became current (see GetCell()) have different text than what was captured when it was added to the queue? See m_integrityFailure – this is purely a diagnostic signal, it does not change what GetCommand() returns.
 
const wxString & GetIntegrityFailureEnqueuedText () const
 The cell's text as it was when AddToQueue() was called, valid only while HasIntegrityFailure() is true for the current cell.
 
const wxString & GetIntegrityFailureCurrentText () const
 The cell's text as AddTokens() actually read it, valid only while HasIntegrityFailure() is true for the current cell.
 
int Size () const
 Get the size of the queue [in cells].
 
int CommandsLeftInCell () const
 Roughly how many commands are still to be run in the current cell. Because commands are tokenized lazily (their exact split depends on the lisp/maxima mode, only known once each prior command's prompt arrives) this is a best-effort progress hint, not an exact count.
 
void MarkCommandSent ()
 Call exactly once, right after the current command's text is actually written to Maxima's socket – starts (or restarts) the "how long has this command been running" clock GetCommandElapsedMilliseconds() reads.
 
long GetCommandElapsedMilliseconds () const
 Milliseconds since MarkCommandSent() was last called for the command currently in flight, or -1 if no command has been sent since the last RemoveFirst()/Clear() (nothing to report an elapsed time for).
 

Static Public Member Functions

static long CommandPositionInCell (const wxString &cellText, long start, long end, std::size_t offset, Configuration *configuration)
 Where in its cell the current command starts.
 

Data Fields

bool m_workingGroupChanged = false
 

Detailed Description

A simple FIFO queue with manual removal of elements.

Member Function Documentation

◆ AddHiddenTreeToQueue()

void EvaluationQueue::AddHiddenTreeToQueue ( const GroupCell *  gr)

Adds all hidden cells attached to the GroupCell gr to the evaluation queue.

Add the tree of hidden cells to the EQ by recursively adding cells' hidden branches to the EQ.

◆ CommandPositionInCell()

long EvaluationQueue::CommandPositionInCell ( const wxString &  cellText,
long  start,
long  end,
std::size_t  offset,
Configuration *  configuration 
)
static

Where in its cell the current command starts.

Together with GetIndex(), which is where it ends, this is the statement an error Maxima reports for this command belongs to (GH #289). -1 if there is no current command.

Where in its cell a position in a command is

A command is not always a verbatim copy of its part of the cell: comments are left out of it, as is whitespace in front. This maps a position in the text sent to Maxima back to the cell, for a command produced in the mode (Maxima or Lisp) configuration is in now.

Parameters
cellTextThe cell's text, as GroupCell::GetEditable()->ToString(true) returns it.
startWhere in it the command starts (GetCommandStart())
endWhere in it the command ends (GetIndex())
offsetThe position in the command's text
Returns
The position in cellText, never beyond end.

◆ GetCell()

GroupCell * EvaluationQueue::GetCell ( )

Gets the cell the next command in the queue belongs to.

The command itself can be read out by issuing GetCommand();

◆ GetUserLabel()

wxString EvaluationQueue::GetUserLabel ( ) const
inline

Query for the label the user has assigned to the current command.

If there is no such label or the label as hidden deep down inside the command (in which case we assume the user wanted to hide it and for example didn't use it as a label at all) we return wxEmptyString.


The documentation for this class was generated from the following files: