8#ifndef TRITON_COMPARABLE_FUNCTOR_H
9#define TRITON_COMPARABLE_FUNCTOR_H
28 template <
class Signature>
32 std::function<Signature> F_;
40 : F_(std::move(F)), ID_(ID) {
45 : F_(F), ID_((void*)F) {
49 template <
class apiType>
50 auto operator()(apiType& api)
const ->
decltype(F_(api)) {
55 template <
class apiType,
class paramType>
56 auto operator()(apiType& api, paramType& param)
const ->
decltype(F_(api, param)) {
57 return F_(api, param);
61 template <
class apiType,
class paramType1,
class paramType2>
62 auto operator()(apiType& api, paramType1& param1, paramType2& param2)
const ->
decltype(F_(api, param1, param2)) {
64 return F_(api, param1, param2);
70 return this->ID_ == O.ID_;
76 return !(this->ID_ == O.ID_);
auto operator()(apiType &api, paramType1 ¶m1, paramType2 ¶m2) const -> decltype(F_(api, param1, param2))
Forward call to real functor.
auto operator()(apiType &api, paramType ¶m) const -> decltype(F_(api, param))
Forward call to real functor.
bool operator==(const ComparableFunctor< T > &O) const
Comparison of functor based on id.
ComparableFunctor(std::function< Signature > F, void *ID)
Constructor.
bool operator!=(const ComparableFunctor< T > &O) const
Comparison of functor based on id.
auto operator()(apiType &api) const -> decltype(F_(api))
Forward call to real functor.
ComparableFunctor(Signature *F)
Constructor.