#pragma once #include "ComplexCommand.h" #include "IComplexCommandCreator.h" #include #include namespace Incart::Usb { template class ComplexCommandCreator final : public IComplexCommandCreator { protected: std::tuple m_args; public: ComplexCommandCreator(TArgs... args) : m_args(std::forward(args)...) { } std::shared_ptr create(std::shared_ptr) override { return createCommand(std::make_index_sequence{}); } private: template std::shared_ptr createCommand(std::index_sequence) { return std::make_shared(std::get(m_args)...); } }; } // namespace Incart::Usb