Skip to content

Commit

Permalink
Fix rule of three violations in AlgorithmContainer classes (#2991)
Browse files Browse the repository at this point in the history
Default constructors are set to 'default' implementations;
Copy constructors and copy assignment operators are deleted in base algorithm container classes.
  • Loading branch information
Vika-F authored Nov 29, 2024
1 parent f32ae79 commit b00966f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cpp/daal/include/algorithms/algorithm_container_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class AlgorithmContainerIface
class AlgorithmContainerIfaceImpl : public AlgorithmContainerIface
{
public:
AlgorithmContainerIfaceImpl() = default;
AlgorithmContainerIfaceImpl(const AlgorithmContainerIfaceImpl &) = delete;
AlgorithmContainerIfaceImpl & operator=(const AlgorithmContainerIfaceImpl & other) = delete;

/**
* Default constructor
* \param[in] daalEnv Pointer to the structure that contains information about the environment
Expand Down Expand Up @@ -97,6 +101,10 @@ template <ComputeMode mode>
class AlgorithmContainer : public AlgorithmContainerIfaceImpl
{
public:
AlgorithmContainer() = default;
AlgorithmContainer(const AlgorithmContainer &) = delete;
AlgorithmContainer<mode> & operator=(const AlgorithmContainer<mode> & other) = delete;

/**
* Default constructor
* \param[in] daalEnv Pointer to the structure that contains information about the environment
Expand Down Expand Up @@ -152,6 +160,9 @@ template <ComputeMode mode>
class AlgorithmContainerImpl : public AlgorithmContainer<mode>
{
public:
AlgorithmContainerImpl(const AlgorithmContainerImpl &) = delete;
AlgorithmContainer<mode> & operator=(const AlgorithmContainer<mode> & other) = delete;

/**
* Default constructor
* \param[in] daalEnv Pointer to the structure that contains information about the environment
Expand Down
7 changes: 7 additions & 0 deletions cpp/daal/include/algorithms/algorithm_container_base_batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ template <>
class AlgorithmContainer<batch> : public AlgorithmContainerIfaceImpl
{
public:
AlgorithmContainer() = default;
AlgorithmContainer(const AlgorithmContainer &) = delete;
AlgorithmContainer<batch> & operator=(const AlgorithmContainer<batch> & other) = delete;

/**
* Default constructor
* \param[in] daalEnv Pointer to the structure that contains information about the environment
Expand Down Expand Up @@ -91,6 +95,9 @@ class AlgorithmContainerImpl<batch> : public AlgorithmContainer<batch>
public:
DAAL_NEW_DELETE();

AlgorithmContainerImpl(const AlgorithmContainerImpl &) = delete;
AlgorithmContainerImpl<batch> & operator=(const AlgorithmContainerImpl<batch> & other) = delete;

/**
* Default constructor
* \param[in] daalEnv Pointer to the structure that contains information about the environment
Expand Down

0 comments on commit b00966f

Please sign in to comment.