#pragma once #include #include #include "SimpleCommandTypes.h" namespace Incart::DevicesInfo { struct SimpleCommandData { ESourceType sourceType; EDataType dataType; EDataType answerType; int32_t width; // если -1 то данные могут быть любой длинны std::vector> options; SimpleCommandData() : sourceType(ESourceType::Fixed) , dataType(EDataType::Binary) , answerType(EDataType::Binary) , width(0) , options({}) { } SimpleCommandData(ESourceType sourceType_, EDataType dataType_, EDataType answerType_, int32_t width_, const std::vector>& options_) : sourceType(sourceType_) , dataType(dataType_) , answerType(answerType_) , width(width_) , options(options_) { } bool containsOption(const std::vector& option) const { for (auto it = options.begin(); it != options.end(); it++) { if (std::equal(it->begin(), it->end(), option.begin())) { return true; } } return false; } }; } // namespace Incart::DevicesInfo