Debian Codegraph @

Kernel/TaxGatheringWalker.h

raw symbols SCIP
1 /* This file is part of the FaCT++ DL reasoner
2 Copyright (C) 2015-2015 Dmitry Tsarkov and The University of Manchester
3 Copyright (C) 2015-2017 Dmitry Tsarkov
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #ifndef TAXGATHERINGWALKER_H
21 #define TAXGATHERINGWALKER_Hcxx . . $ `Kernel/TaxGatheringWalker.h:21:9`!
22
23 #include "WalkerInterface.h"cxx . . $ `<file>/Kernel/WalkerInterface.h`/
24 #include "taxVertex.h"cxx . . $ `<file>/Kernel/taxVertex.h`/
25
26 /// taxonomy walkers that gathers all the relevant nodes
27 class TaxGatheringWalkercxx . . $ TaxGatheringWalker# : public WalkerInterfacecxx . . $ WalkerInterface#
28 {
29 protected: // members
30 /// vertices that satisfy the condition
31 stdcxx . . $ std/::vectorcxx . . $ std/vector#<const TaxonomyVertexcxx . . $ TaxonomyVertex#*> foundcxx . . $ TaxGatheringWalker#found.;
32
33 protected: // methods
34 /// check whether actor is applicable to the ENTRY
35 virtual bool applicablecxx . . $ TaxGatheringWalker#applicable(c2bbfa133def1eb7). ( const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry ) const = 0;
36 /// @return true iff current entry is visible
37 bool tryEntrycxx . . $ TaxGatheringWalker#tryEntry(c2bbfa133def1eb7). ( const ClassifiableEntrycxx . . $ ClassifiableEntry#* p ) const { return !p->isSystemcxx . . $ TNamedEntry#isSystem(50ce9a9e25b4a850).() && applicablecxx . . $ TaxGatheringWalker#applicable(c2bbfa133def1eb7).(p); }
38 /// @return true if at least one entry of a vertex V is visible
39 bool tryVertexcxx . . $ TaxGatheringWalker#tryVertex(a18b4b0cd30d1e91). ( const TaxonomyVertexcxx . . $ TaxonomyVertex#& v ) const
40 {
41 if ( tryEntrycxx . . $ TaxGatheringWalker#tryEntry(c2bbfa133def1eb7).(v.getPrimercxx . . $ TaxonomyVertex#getPrimer(257357278432d96a).()) )
42 return true;
43 for ( const auto& synonym: v.synonymscxx . . $ TaxonomyVertex#synonyms(c783afb9bc916663).() )
44 if ( tryEntrycxx . . $ TaxGatheringWalker#tryEntry(c2bbfa133def1eb7).(synonym) )
45 return true;
46 return false;
47 }
48
49 public: // interface
50 /// clear found
51 virtual void clearcxx . . $ TaxGatheringWalker#clear(49f6e7a06ebc5aa8). ( void ) { foundcxx . . $ TaxGatheringWalker#found..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); }
52
53 /// taxonomy walking method.
54 /// @return true if node was processed
55 /// @return false if node can not be processed in current settings
56 bool applycxx . . $ TaxGatheringWalker#apply(9e72d36cb75ed014). ( const TaxonomyVertexcxx . . $ TaxonomyVertex#& v ) override
57 {
58 if ( tryVertexcxx . . $ TaxGatheringWalker#tryVertex(a18b4b0cd30d1e91).(v) )
59 {
60 foundcxx . . $ TaxGatheringWalker#found..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(&v);
61 return true;
62 }
63 return false;
64 }
65 }; // TaxGatheringWalker
66
67 #endif