GCode Processor
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GCodeLineEntryStack Class Reference

Stack of GCodeLineEntry's. More...

#include <GCodeLineEntryStack.h>

Public Member Functions

 GCodeLineEntryStack (TriggerParameters &&trigger_params)
 
 ~GCodeLineEntryStack ()=default
 Default destructor.
 
 GCodeLineEntryStack (const GCodeLineEntryStack &)=delete
 Deleted copy constructor.
 
 GCodeLineEntryStack (GCodeLineEntryStack &&)=delete
 Deleted move constructor.
 
GCodeLineEntryStackoperator= (const GCodeLineEntryStack &)=delete
 Deleted copy assignment operator.
 
GCodeLineEntryStackoperator= (GCodeLineEntryStack &&)=delete
 Deleted move assignment operator.
 
std::pair< bool, GCodeLineEntrypush (const std::pair< bool, GCodeLineEntry > &entry)
 Pushes the entry in the stack discarding the first one and, possibly, interpolates the stack entries. More...
 
decltype(auto) getStack () const
 Returns the internal stack.
 

Private Member Functions

std::pair< bool, GCodeLineEntryinterpolate () const
 Interpolates between the entries of the Stack_.
 

Private Attributes

std::vector< std::pair< bool, GCodeLineEntry > > Stack_
 The two temporary elements to interpolate between.
 
const TriggerParameters MinimumTriggerParameters_
 The threshold for the parameters to trigger the interpolation.
 

Detailed Description

Stack of GCodeLineEntry's.

Keeps track of the last two read-in line entries and interpolates among them if necessary.

Constructor & Destructor Documentation

GCodeLineEntryStack ( TriggerParameters &&  trigger_params)
explicit

Constructor.

Parameters
trigger_paramsExtruder parameters that will trigger the interpolation.

Member Function Documentation

std::pair< bool, GCodeLineEntry > push ( const std::pair< bool, GCodeLineEntry > &  entry)

Pushes the entry in the stack discarding the first one and, possibly, interpolates the stack entries.

Parameters
entryThe enry to push in the stack.
Returns
A pair whose entries have to be interpreted as follows:
  • pair.first tells whether the stack entries have been interpolated;
  • pair.second the interpolated GCodeLineEntry. If an interpolation didn't take place, this is just a dummy value and must be ignored.

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