tetengo 1.8.1
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::lattice::constraint Class Reference

A constraint. More...

#include <constraint.hpp>

+ Inheritance diagram for tetengo::lattice::constraint:
+ Collaboration diagram for tetengo::lattice::constraint:

Public Member Functions

 constraint ()
 Creates an empty constraint.
 
 constraint (std::vector< std::unique_ptr< constraint_element > > &&pattern)
 Creates a constraint.
 
 ~constraint ()
 Destroys the constraint.
 
bool matches (const std::vector< node > &reverse_path) const
 Returns true when the path matches the pattern.
 
bool matches_tail (const std::vector< node > &reverse_tail_path) const
 Returns true when the tail path matches the tail of the pattern.
 

Detailed Description

A constraint.

Constructor & Destructor Documentation

◆ constraint() [1/2]

tetengo::lattice::constraint::constraint ( )

Creates an empty constraint.

It matches any path.

◆ constraint() [2/2]

tetengo::lattice::constraint::constraint ( std::vector< std::unique_ptr< constraint_element > > &&  pattern)
explicit

Creates a constraint.

Parameters
patternA pattern.

Member Function Documentation

◆ matches()

bool tetengo::lattice::constraint::matches ( const std::vector< node > &  reverse_path) const

Returns true when the path matches the pattern.

Parameters
reverse_pathA path in reverse order.
Return values
trueWhen the path matches the pattern.
falseOtherwise.

◆ matches_tail()

bool tetengo::lattice::constraint::matches_tail ( const std::vector< node > &  reverse_tail_path) const

Returns true when the tail path matches the tail of the pattern.

Parameters
reverse_tail_pathA tail path in reverse order.
Return values
trueWhen the tail path matches the tail of the pattern.
falseOtherwise.

The documentation for this class was generated from the following file: