#include <step_queue.h>
Public Types | |
typedef boost::shared_ptr< const StepQueue > | ConstPtr |
typedef boost::shared_ptr< StepQueue > | Ptr |
Public Member Functions | |
void | clearDirtyFlag () |
Resets dirty flag. More... | |
bool | empty () const |
Checks if there are steps in queue. More... | |
int | firstStepIndex () const |
Returns next step index enqueued for execution. More... | |
bool | getStep (msgs::Step &step, unsigned int step_index=0u) |
Retrieves step of execution queue. More... | |
bool | getStepAt (msgs::Step &step, unsigned int position=0u) |
Retrieves step of execution queue. More... | |
std::vector< msgs::Step > | getSteps (unsigned int start_index, unsigned int end_index) const |
getSteps Retrieves all steps with index in range of [start_index; end_index] More... | |
bool | isDirty () const |
Returns if step queue has been changed. More... | |
int | lastStepIndex () const |
Returns last step index enqueued for execution. More... | |
bool | popStep (msgs::Step &step) |
Dequeues and returns next step from execution queue. More... | |
bool | popStep () |
void | removeStep (unsigned int step_index) |
Remove steps with specific index from queue. More... | |
void | removeSteps (unsigned int from_step_index, int to_step_index=-1) |
Remove steps in the given range [from_step_index, to_step_index]. More... | |
void | reset () |
size_t | size () const |
Returns size of step queue. More... | |
StepQueue () | |
bool | updateStepPlan (const msgs::StepPlan &step_plan, int min_step_index=0) |
Merges given step plan to the current execution queue of steps. Hereby, two cases have to considered: More... | |
virtual | ~StepQueue () |
Protected Attributes | |
bool | is_dirty_ |
Mutex | queue_mutex_ |
StepPlan | step_plan_ |
Definition at line 51 of file step_queue.h.
typedef boost::shared_ptr<const StepQueue> vigir_step_control::StepQueue::ConstPtr |
Definition at line 56 of file step_queue.h.
Definition at line 55 of file step_queue.h.
vigir_step_control::StepQueue::StepQueue | ( | ) |
Definition at line 7 of file step_queue.cpp.
|
virtual |
Definition at line 11 of file step_queue.cpp.
void vigir_step_control::StepQueue::clearDirtyFlag | ( | ) |
Resets dirty flag.
Definition at line 40 of file step_queue.cpp.
bool vigir_step_control::StepQueue::empty | ( | ) | const |
Checks if there are steps in queue.
Definition at line 22 of file step_queue.cpp.
int vigir_step_control::StepQueue::firstStepIndex | ( | ) | const |
Returns next step index enqueued for execution.
Definition at line 177 of file step_queue.cpp.
bool vigir_step_control::StepQueue::getStep | ( | msgs::Step & | step, |
unsigned int | step_index = 0u |
||
) |
Retrieves step of execution queue.
step | Outgoing variable for retrieved step. |
index | Position of step in queue to be returned. 0 points to the next step to be executed next. |
Definition at line 121 of file step_queue.cpp.
bool vigir_step_control::StepQueue::getStepAt | ( | msgs::Step & | step, |
unsigned int | position = 0u |
||
) |
Retrieves step of execution queue.
step | Outgoing variable for retrieved step. |
position | Position of step in queue to be returned. 0 points to the next step to be executed next. |
Definition at line 127 of file step_queue.cpp.
std::vector< msgs::Step > vigir_step_control::StepQueue::getSteps | ( | unsigned int | start_index, |
unsigned int | end_index | ||
) | const |
getSteps Retrieves all steps with index in range of [start_index; end_index]
start_index | Starting index |
end_index | Ending index |
Definition at line 133 of file step_queue.cpp.
bool vigir_step_control::StepQueue::isDirty | ( | ) | const |
Returns if step queue has been changed.
Definition at line 34 of file step_queue.cpp.
int vigir_step_control::StepQueue::lastStepIndex | ( | ) | const |
Returns last step index enqueued for execution.
Definition at line 188 of file step_queue.cpp.
bool vigir_step_control::StepQueue::popStep | ( | msgs::Step & | step | ) |
Dequeues and returns next step from execution queue.
step | Outgoing variable for dequeued step. |
Definition at line 163 of file step_queue.cpp.
bool vigir_step_control::StepQueue::popStep | ( | ) |
Definition at line 170 of file step_queue.cpp.
void vigir_step_control::StepQueue::removeStep | ( | unsigned int | step_index | ) |
Remove steps with specific index from queue.
step_index | Step to be removed |
Definition at line 149 of file step_queue.cpp.
void vigir_step_control::StepQueue::removeSteps | ( | unsigned int | from_step_index, |
int | to_step_index = -1 |
||
) |
Remove steps in the given range [from_step_index, to_step_index].
from_step_index | start index |
to_step_index | end index; to_step_index < 0 is equal to removing all steps with index >= from_step_index |
Definition at line 156 of file step_queue.cpp.
void vigir_step_control::StepQueue::reset | ( | ) |
Definition at line 15 of file step_queue.cpp.
size_t vigir_step_control::StepQueue::size | ( | ) | const |
bool vigir_step_control::StepQueue::updateStepPlan | ( | const msgs::StepPlan & | step_plan, |
int | min_step_index = 0 |
||
) |
Merges given step plan to the current execution queue of steps. Hereby, two cases have to considered:
step_plan | Step plan to be merged into execution queue. |
min_step_index | Only steps with index >= min_step_index are considered for merge |
check for consistency
merge step plan
Definition at line 46 of file step_queue.cpp.
|
protected |
Definition at line 157 of file step_queue.h.
|
mutableprotected |
Definition at line 160 of file step_queue.h.
|
protected |
Definition at line 155 of file step_queue.h.