moveit_task_constructor/include/moveit_task_constructor/container.h
Robert Haschke bb06eda33c containers
- allow hierarchical organization of stages (serially for now)
- validate correctness of tree (at composition time, i.e. runtime)
- derive Task from SerialContainer
- fix pimpl_func(), PRIVATE_CLASS declaration in "public" section to allow access in tests
2017-10-04 00:11:22 +02:00

45 lines
1.1 KiB
C++

#pragma once
#include "subtask.h"
namespace moveit { namespace task_constructor {
class ContainerBasePrivate;
class ContainerBase : public SubTask
{
public:
PRIVATE_CLASS(ContainerBase)
typedef std::unique_ptr<SubTask> value_type;
typedef std::function<bool(const SubTask&, int depth)> StageCallback;
typedef std::function<bool(const std::vector<SubTrajectory*>&)> SolutionCallback;
virtual bool canInsert(const value_type& stage, int before = -1) const = 0;
virtual bool insert(value_type&& stage, int before = -1) = 0;
virtual void clear();
bool traverseStages(const StageCallback &processor) const;
protected:
ContainerBase(ContainerBasePrivate* impl);
};
class SerialContainerPrivate;
class SerialContainer : public ContainerBase
{
public:
PRIVATE_CLASS(SerialContainer)
SerialContainer(const std::string& name);
bool canInsert(const value_type& stage, int before = -1) const override;
bool insert(value_type&& stage, int before = -1) override;
bool canCompute() const override;
bool compute() override;
protected:
SerialContainer(SerialContainerPrivate* impl);
};
} }