Skip to content
Snippets Groups Projects
Commit ce15b543 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

MatchResult - return type for conditions of match operator.

It's a tuple boolean/Match Value - "is it matched?"/"actual match"
parent bdbfc588
Branches
No related merge requests found
#ifndef LIBWCCL_OPS_MATCH_MATCHRESULT_H
#define LIBWCCL_OPS_MATCH_MATCHRESULT_H
#include <libwccl/values/bool.h>
#include <libwccl/values/match.h>
namespace Wccl {
/**
* Class that represents a result of MatchCondition
*/
class MatchResult
{
public:
MatchResult(bool matched, const boost::shared_ptr<Match>& match);
MatchResult();
boost::shared_ptr<Match> get_match() const;
bool matched() const;
private:
bool _matched;
boost::shared_ptr<Match> _match;
};
// --- Implementation details ---
inline
MatchResult::MatchResult() : _matched(false), _match() {
}
inline
MatchResult::MatchResult(bool matched, const boost::shared_ptr<Match>& match)
: _matched(matched),
_match(match) {
}
inline
bool MatchResult::matched() const {
return _matched;
}
inline
boost::shared_ptr<Match> MatchResult::get_match() const {
return _match;
}
} /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_MATCHRESULT_H
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment