Class condition
Defined in File condition.hpp
Class Documentation
-
class condition
The interface class for conditions. This uses the bridge pattern, which means the implementation is in the member m_impl.
Public Functions
-
inline condition()
Construct a new, empty condition object.
-
inline explicit condition(condition_impl *impl)
Construct a new condition object with implementation impl.
- Parameters
impl – The implementation to use
-
inline condition(condition &&rhs) noexcept
Construct a new condition object moving the data from rhs.
-
inline condition &operator=(condition &&rhs) noexcept
Assignment operator moving the data from rhs.
-
inline ~condition()
-
void prepare(const category &c)
Prepare the condition to be used on category c. This will take care of setting the correct indices for fields e.g.
- Parameters
c – The category this query should act upon
-
inline bool operator()(row_handle r) const
This operator returns true if the row referenced by r is a match for this condition.
- Parameters
r – The reference to a row.
- Returns
true If there is a match
- Returns
false If there is no match
-
inline explicit operator bool()
Return true if the condition is not empty.
-
inline bool empty() const
Return true if the condition is empty, has no condition.
-
inline std::optional<row_handle> single() const
If the prepare step found out there is only one hit this single hit can be returned by this method.
- Returns
std::optional<row_handle> The result will contain a row reference if there is a single hit, it will be empty otherwise
-
inline condition()