diff --git a/cpp/include/DataStorm/InternalI.h b/cpp/include/DataStorm/InternalI.h index f67cf339bad..4ca15915de3 100644 --- a/cpp/include/DataStorm/InternalI.h +++ b/cpp/include/DataStorm/InternalI.h @@ -142,7 +142,6 @@ namespace DataStormI virtual ~FilterFactory() = default; virtual std::shared_ptr get(std::int64_t) const = 0; - virtual std::shared_ptr decode(const Ice::CommunicatorPtr&, const Ice::ByteSeq&) = 0; }; class FilterManager diff --git a/cpp/include/DataStorm/InternalT.h b/cpp/include/DataStorm/InternalT.h index 603d5d9b00b..be9800b7190 100644 --- a/cpp/include/DataStorm/InternalT.h +++ b/cpp/include/DataStorm/InternalT.h @@ -425,8 +425,11 @@ namespace DataStormI template class FilterT final : public Filter, public AbstractElementT { public: - template - FilterT(CC&& criteria, std::int64_t id) : AbstractElementT::AbstractElementT(std::forward(criteria), id) + template + FilterT(CC&& criteria, std::string name, FF lambda, std::int64_t id) + : AbstractElementT::AbstractElementT(std::forward(criteria), id), + _name(std::move(name)), + _lambda(std::move(lambda)) { } @@ -439,12 +442,6 @@ namespace DataStormI const std::string& getName() const final { return _name; } - template void init(const std::string& name, FF&& lambda) - { - _name = name; - _lambda = std::forward(lambda); - } - using BaseClassType = Filter; private: @@ -463,11 +460,6 @@ namespace DataStormI return AbstractFactoryT>::getImpl(id); } - std::shared_ptr decode(const Ice::CommunicatorPtr& communicator, const Ice::ByteSeq& data) final - { - return AbstractFactoryT>::create(DecoderT::decode(communicator, data)); - } - static std::shared_ptr> createFactory() { auto f = std::make_shared>(); @@ -499,9 +491,8 @@ namespace DataStormI std::shared_ptr create(Criteria criteria) { - auto filter = std::static_pointer_cast>(filterFactory.create(criteria)); - filter->init(name, lambda(filter->get())); - return filter; + return std::static_pointer_cast>( + filterFactory.create(criteria, name, lambda(criteria))); } std::shared_ptr get(std::int64_t id) const final { return filterFactory.get(id); }