Fawkes API  Fawkes Development Version
node_constraint.h
1 /***************************************************************************
2  * node_constraint.h - base class for nod constraints
3  *
4  * Created: Sun Mar 02 10:47:35 2014
5  * Copyright 2014 Sebastian Reuter
6  * 2014 Tim Niemueller
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef _NAVGRAPH_CONSTRAINTS_NODE_CONSTRAINT_H_
23 #define _NAVGRAPH_CONSTRAINTS_NODE_CONSTRAINT_H_
24 
25 #include <navgraph/navgraph_node.h>
26 
27 #include <string>
28 #include <vector>
29 
30 namespace fawkes {
31 
32 class Logger;
33 
35 {
36 public:
37  NavGraphNodeConstraint(const std::string &name);
38  NavGraphNodeConstraint(const char *name);
39  virtual ~NavGraphNodeConstraint();
40 
41  std::string name();
42 
43  virtual bool compute(void) throw();
44  virtual bool blocks(const fawkes::NavGraphNode &node) throw() = 0;
45 
46  bool operator==(const std::string &name) const;
47 
48 protected:
49  std::string name_;
50 };
51 
52 } // end namespace fawkes
53 
54 #endif
fawkes::NavGraphNodeConstraint::~NavGraphNodeConstraint
virtual ~NavGraphNodeConstraint()
Virtual empty destructor.
Definition: node_constraint.cpp:61
fawkes::NavGraphNode
Topological graph node.
Definition: navgraph_node.h:36
fawkes::NavGraphNodeConstraint::compute
virtual bool compute(void)
Perform compuations before graph search and to indicate re-planning.
Definition: node_constraint.cpp:93
fawkes::NavGraphNodeConstraint
Constraint that can be queried to check if a node is blocked.
Definition: node_constraint.h:35
fawkes::NavGraphNodeConstraint::name
std::string name()
Get name of constraint.
Definition: node_constraint.cpp:69
fawkes
Fawkes library namespace.
fawkes::NavGraphNodeConstraint::name_
std::string name_
Name of constraint.
Definition: node_constraint.h:49
fawkes::NavGraphNodeConstraint::blocks
virtual bool blocks(const fawkes::NavGraphNode &node)=0
Check if constraint blocks a node.
fawkes::NavGraphNodeConstraint::NavGraphNodeConstraint
NavGraphNodeConstraint(const std::string &name)
Constructor.
Definition: node_constraint.cpp:47
fawkes::NavGraphNodeConstraint::operator==
bool operator==(const std::string &name) const
Check if constraint matches name.
Definition: node_constraint.cpp:104