tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
constraint.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_LATTICE_CONSTRAINT_HPP)
8#define TETENGO_LATTICE_CONSTRAINT_HPP
9
10#include <memory>
11#include <vector>
12
13#include <boost/core/noncopyable.hpp>
14
15
16namespace tetengo::lattice
17{
18 class constraint_element;
19 class node;
20
21
25 class constraint : private boost::noncopyable
26 {
27 public:
28 // constructors and destructor
29
36
42 explicit constraint(std::vector<std::unique_ptr<constraint_element>>&& pattern);
43
48
49
50 // functions
51
60 [[nodiscard]] bool matches(const std::vector<node>& reverse_path) const;
61
70 [[nodiscard]] bool matches_tail(const std::vector<node>& reverse_tail_path) const;
71
72
73 private:
74 // types
75
76 class impl;
77
78
79 // variables
80
81 const std::unique_ptr<impl> m_p_impl;
82 };
83
84
85}
86
87
88#endif
A constraint.
Definition constraint.hpp:26
bool matches_tail(const std::vector< node > &reverse_tail_path) const
Returns true when the tail path matches the tail of the pattern.
constraint()
Creates an empty constraint.
bool matches(const std::vector< node > &reverse_path) const
Returns true when the path matches the pattern.
constraint(std::vector< std::unique_ptr< constraint_element > > &&pattern)
Creates a constraint.
~constraint()
Destroys the constraint.
A lattice library.