diff --git a/cpp/daal/include/algorithms/algorithm_types.h b/cpp/daal/include/algorithms/algorithm_types.h index 76719f80f2d..cb78673bf56 100644 --- a/cpp/daal/include/algorithms/algorithm_types.h +++ b/cpp/daal/include/algorithms/algorithm_types.h @@ -219,11 +219,17 @@ class DAAL_EXPORT Argument protected: /** - * Copy constructor - * \param[in] other Instance of the same class to copy - */ + * Copy constructor + * \param[in] other Instance of the same class to copy + */ Argument(const Argument & other); + /** + * Copy assignment operator + * \param[in] other Instance of the same class to copy + */ + Argument & operator=(const Argument & other); + /** * Retrieves specified element * \param[in] index Index of the element @@ -326,6 +332,8 @@ class Input : public Argument * \param[in] other Instance of the same class to copy */ Input(const Input & other) : Argument(other) {} + + Input & operator=(const Input & other) = default; }; /** diff --git a/cpp/daal/include/data_management/data/data_dictionary.h b/cpp/daal/include/data_management/data/data_dictionary.h index 2308e152f84..6ca0aa7909a 100755 --- a/cpp/daal/include/data_management/data/data_dictionary.h +++ b/cpp/daal/include/data_management/data/data_dictionary.h @@ -71,11 +71,25 @@ class NumericTableFeature : public SerializationIface categoryNumber = 0; } + /** + * Copy constructor for a data feature + */ + NumericTableFeature(const NumericTableFeature & f) + { + indexType = f.indexType; + pmmlType = f.pmmlType; + featureType = f.featureType; + typeSize = f.typeSize; + categoryNumber = f.categoryNumber; + } + /** * Copy operator for a data feature */ NumericTableFeature & operator=(const NumericTableFeature & f) { + if (this == &f) return *this; + indexType = f.indexType; pmmlType = f.pmmlType; featureType = f.featureType; diff --git a/cpp/daal/src/algorithms/algorithm_base_impl.cpp b/cpp/daal/src/algorithms/algorithm_base_impl.cpp index 4e608c704c5..0f774c1e5dc 100644 --- a/cpp/daal/src/algorithms/algorithm_base_impl.cpp +++ b/cpp/daal/src/algorithms/algorithm_base_impl.cpp @@ -55,6 +55,14 @@ algorithms::Argument::Argument(const algorithms::Argument & other) : _storage(new internal::ArgumentStorage(*(internal::ArgumentStorage *)other._storage.get())), idx(0) {} +algorithms::Argument & algorithms::Argument::operator=(const algorithms::Argument & other) +{ + if (this == &other) return *this; + _storage = data_management::DataCollectionPtr(new internal::ArgumentStorage(*(internal::ArgumentStorage *)other._storage.get())); + idx = 0; + return *this; +} + const data_management::SerializationIfacePtr & algorithms::Argument::get(size_t index) const { return (*_storage)[index];