OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
InitiateSearchCB.h
Go to the documentation of this file.
1 /*
2  * InitiateSearchCB.h
3  *
4  * Copyright (C) 2015 Linas Vepstas <linasvepstas@gmail.com>
5  * All Rights Reserved
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License v3 as
9  * published by the Free Software Foundation and including the exceptions
10  * at http://opencog.org/wiki/Licenses
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program; if not, write to:
19  * Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Created by Linas Vepstas April 2015
23  */
24 
25 #ifndef _OPENCOG_INITIATE_SEARCH_H
26 #define _OPENCOG_INITIATE_SEARCH_H
27 
32 
33 namespace opencog {
34 
42 class InitiateSearchCB : public virtual PatternMatchCallback
43 {
44  public:
46 
52  virtual void set_pattern(const Variables&, const Pattern&);
53  virtual bool initiate_search(PatternMatchEngine *);
54 
55  protected:
56 
58 
60  const Pattern* _pattern;
62  const std::set<Handle>* _dynamic;
63 
66 
67  virtual Handle find_starter(const Handle&, size_t&, Handle&, size_t&);
68  virtual Handle find_thinnest(const HandleSeq&,
69  const std::set<Handle>&,
70  Handle&, size_t&);
71  virtual void find_rarest(const Handle&, Handle&, size_t&);
72 
74  virtual bool neighbor_search(PatternMatchEngine *);
75  virtual bool link_type_search(PatternMatchEngine *);
76  virtual bool variable_search(PatternMatchEngine *);
77  virtual bool no_search(PatternMatchEngine *);
78 
80 };
81 
82 } // namespace opencog
83 
84 #endif // _OPENCOG_INITIATE_SEARCH_H
virtual Handle find_thinnest(const HandleSeq &, const std::set< Handle > &, Handle &, size_t &)
virtual bool neighbor_search(PatternMatchEngine *)
std::vector< Handle > HandleSeq
a list of handles
Definition: Handle.h:246
std::map< Handle, const std::set< Type > > VariableTypeMap
Definition: Pattern.h:43
const Variables * _variables
virtual bool link_type_search(PatternMatchEngine *)
const VariableTypeMap * _type_restrictions
virtual void find_rarest(const Handle &, Handle &, size_t &)
const std::set< Handle > * _dynamic
virtual bool no_search(PatternMatchEngine *)
virtual Handle find_starter(const Handle &, size_t &, Handle &, size_t &)
virtual bool variable_search(PatternMatchEngine *)
virtual bool initiate_search(PatternMatchEngine *)
virtual void set_pattern(const Variables &, const Pattern &)