Skip to content

Commit

Permalink
Poprawna implementacja wkaźnika shared na klasę reader oraz aktualiza…
Browse files Browse the repository at this point in the history
…cja pliku gitignore o pliki tymczasowe programu vscode
  • Loading branch information
vnuczek committed Sep 12, 2024
1 parent 95ef18b commit d9cae14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ source/results/
/results/exp-005
/doxygen/html
/.vs
/.vscode
# Temporary VS file
*.pdb
8 changes: 5 additions & 3 deletions source/readers/cross_validation_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
#include "cross_validation_model.h"

ksi::cross_validation_model::cross_validation_model(ksi::reader& source_reader)
: pReader(source_reader.clone()) {}
{
pReader = std::shared_ptr<ksi::reader>(source_reader.clone());
}

ksi::cross_validation_model::cross_validation_model(const cross_validation_model& other)
: pReader(other.pReader)
{
pReader = std::shared_ptr<ksi::reader>(other.pReader->clone());
std::lock_guard<std::mutex> lock(other.datasets_mutex);
datasets = other.datasets;
}
Expand All @@ -23,7 +25,7 @@ ksi::cross_validation_model& ksi::cross_validation_model::operator=(const cross_
{
if (this != &other)
{
pReader = other.pReader;
pReader = std::shared_ptr<ksi::reader>(other.pReader->clone());
std::lock_guard<std::mutex> lock(other.datasets_mutex);
datasets = other.datasets;
}
Expand Down

0 comments on commit d9cae14

Please sign in to comment.