hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
problem-target.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016 CNRS
3 // Authors: Joseph Mirabel
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_PROBLEM_TARGET_HH
20 # define HPP_CORE_PROBLEM_TARGET_HH
21 
22 # include <hpp/core/fwd.hh>
23 # include <hpp/core/config.hh>
24 
25 namespace hpp {
26  namespace core {
29 
34  class HPP_CORE_DLLAPI ProblemTarget {
35  public:
36  virtual ~ProblemTarget () {};
37 
39  virtual void check (const RoadmapPtr_t& roadmap) const = 0;
40 
42  virtual bool reached (const RoadmapPtr_t& roadmap) const = 0;
43 
46  virtual PathVectorPtr_t computePath(const RoadmapPtr_t& roadmap) const = 0;
47 
49  void problem (const ProblemPtr_t& problem)
50  {
51  problem_ = problem;
52  }
53 
54  protected:
56  ProblemTarget (const ProblemPtr_t& problem)
57  : problem_ (problem)
58  {}
59 
61  void init (const ProblemTargetWkPtr_t& weak)
62  {
63  weakPtr_ = weak;
64  }
65 
67  ProblemWkPtr_t problem_;
68 
70  ProblemTargetWkPtr_t weakPtr_;
71 
72  private:
73  }; // class ProblemTarget
75  } // namespace core
76 } // namespace hpp
77 #endif // HPP_CORE_PROBLEM_TARGET_HH
void init(const ProblemTargetWkPtr_t &weak)
Store weak pointer to itself.
Definition: problem-target.hh:61
ProblemTargetWkPtr_t weakPtr_
Store weak pointer to itself.
Definition: problem-target.hh:70
Definition: problem-target.hh:34
ProblemWkPtr_t problem_
Reference to the planner for access to problem and roadmap.
Definition: problem-target.hh:67
void problem(const ProblemPtr_t &problem)
Set the problem.
Definition: problem-target.hh:49
virtual ~ProblemTarget()
Definition: problem-target.hh:36
boost::shared_ptr< PathVector > PathVectorPtr_t
Definition: fwd.hh:176
boost::shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:181
ProblemTarget(const ProblemPtr_t &problem)
Constructor.
Definition: problem-target.hh:56
boost::shared_ptr< Problem > ProblemPtr_t
Definition: fwd.hh:179