GCode Processor
GCodeLineEntryStack.h
Go to the documentation of this file.
1 
6 #ifndef GCode_Line_Entry_Stack_h
7 #define GCode_Line_Entry_Stack_h
8 
9 #include "GCodeLineEntry.h"
10 #include "TriggerParameters.h"
11 
12 #include <utility>
13 #include <vector>
14 
19 {
20 public:
23  explicit GCodeLineEntryStack(TriggerParameters&& trigger_params);
24 
26  ~GCodeLineEntryStack() = default;
27 
36 
45  std::pair<bool, GCodeLineEntry> push(const std::pair<bool, GCodeLineEntry>& entry);
46 
48  decltype(auto) getStack() const
49  { return Stack_; }
50 
51 private:
53  std::vector<std::pair<bool, GCodeLineEntry>> Stack_;
54 
57 
59  std::pair<bool, GCodeLineEntry> interpolate() const;
60 };
61 
62 #endif
Parameters of the extruder movements.
Definition: TriggerParameters.h:10
GCodeLineEntryStack & operator=(const GCodeLineEntryStack &)=delete
Deleted copy assignment operator.
std::pair< bool, GCodeLineEntry > interpolate() const
Interpolates between the entries of the Stack_.
Definition: GCodeLineEntryStack.cpp:71
const TriggerParameters MinimumTriggerParameters_
The threshold for the parameters to trigger the interpolation.
Definition: GCodeLineEntryStack.h:56
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...
Definition: GCodeLineEntryStack.cpp:50
GCodeLineEntryStack(TriggerParameters &&trigger_params)
Definition: GCodeLineEntryStack.cpp:20
std::vector< std::pair< bool, GCodeLineEntry > > Stack_
The two temporary elements to interpolate between.
Definition: GCodeLineEntryStack.h:53
Stack of GCodeLineEntry&#39;s.
Definition: GCodeLineEntryStack.h:18
~GCodeLineEntryStack()=default
Default destructor.
decltype(auto) getStack() const
Returns the internal stack.
Definition: GCodeLineEntryStack.h:48