22 #ifndef __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_OREXP_H__
23 #define __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_OREXP_H__
31 template<
typename EventType>
40 operand1_->Accept(filter_visitor);
41 operand2_->Accept(filter_visitor);
42 filter_visitor.
Visit(
this);
45 virtual operator boost::shared_ptr<FilterExp<EventType>>()
const {
46 M2ETIS_LOG_DEBUG(
"OrExp",
"conversion operator in FilterExp to shared_ptr<FilterExp<EventType>>. Originally only intented for debugging purposes");
47 return boost::make_shared<OrExp<EventType> >(*this);
51 virtual operator std::string()
const override {
52 return (std::string(
"OrExp") +
"(\n" + std::string(*operand1_) +
", \t\t " + std::string(*operand2_) +
")");
56 boost::shared_ptr<FilterExp<EventType>> operand1_;
57 boost::shared_ptr<FilterExp<EventType>> operand2_;
60 const OrExp * other_OrExp =
dynamic_cast<const OrExp *
>(&other_filter);
63 return (*operand1_ == *(other_OrExp->operand1_) && *operand2_ == *(other_OrExp->operand2_));
69 virtual size_t doHash()
const {
70 return std::hash<FilterExp<EventType>>()(*operand1_) ^ std::hash<FilterExp<EventType>>()(*operand2_);
74 template<
typename Archive>
75 void serialize(Archive & ar,
const unsigned int) {
76 ar & boost::serialization::base_object<FilterExp<EventType>>(*this);
friend class boost::serialization::access
virtual void Accept(FilterVisitor< EventType > &filter_visitor) const override
#define M2ETIS_LOG_DEBUG(module, message)
virtual void Visit(const FilterExp< EventType > *)=0
OrExp(const boost::shared_ptr< FilterExp< EventType >> op1, const boost::shared_ptr< FilterExp< EventType >> op2)