/* * FunctorLogic.hpp * * Created on: 20 мая 2020 г. * Author: LeonidTitov */ #ifndef UMLIBRARY_SCHEMATIC_FUNCTORLOGIC_HPP_ #define UMLIBRARY_SCHEMATIC_FUNCTORLOGIC_HPP_ #include "../systemic/IFunctor.hh" #include #include namespace systemic { namespace detail { template class FunctorLogic : public IFunctor { public: FunctorLogic(Logic logic, IFunctor & lhs, IFunctor & rhs ); ReturnType operator()( Args ... args ); private: Logic logic; IFunctor & lhs; IFunctor & rhs; }; template inline systemic::detail::FunctorLogic::FunctorLogic( Logic logic, IFunctor & lhs, IFunctor & rhs) : logic(logic), lhs(lhs), rhs(rhs) {} template inline ReturnType systemic::detail::FunctorLogic::operator()( Args ... args ) { return logic( lhs( args... ), rhs( args... ) ); } } } #endif /* UMLIBRARY_SCHEMATIC_FUNCTORLOGIC_HPP_ */