Refactored the inputvector part of the som implementation

This commit is contained in:
emeric
2019-03-08 15:46:29 +01:00
parent 11a0ed9f12
commit 45b4468c01
19 changed files with 839 additions and 600 deletions
+6 -2
View File
@@ -119,11 +119,15 @@ Track::getAllWithMBIDAndMissingFeatures(Wt::Dbo::Session& session)
}
std::vector<Track::pointer>
Track::getAllWithFeatures(Wt::Dbo::Session& session)
Track::getAllWithFeatures(Wt::Dbo::Session& session, boost::optional<std::size_t> limit)
{
int size {limit ? static_cast<int>(*limit) : -1};
Wt::Dbo::collection<pointer> res = session.query<pointer>
("SELECT t FROM track t")
.where("EXISTS (SELECT * from track_features t_f WHERE t_f.track_id = t.id)");
.where("EXISTS (SELECT * from track_features t_f WHERE t_f.track_id = t.id)")
.limit(size);
return std::vector<pointer>(res.begin(), res.end());
}
+1 -1
View File
@@ -70,7 +70,7 @@ class Track : public Wt::Dbo::Dbo<Track>
static std::vector<pointer> getChecksumDuplicates(Wt::Dbo::Session& session);
static std::vector<pointer> getLastAdded(Wt::Dbo::Session& session, Wt::WDateTime after, int size = 1);
static std::vector<pointer> getAllWithMBIDAndMissingFeatures(Wt::Dbo::Session& session); // nested transaction
static std::vector<pointer> getAllWithFeatures(Wt::Dbo::Session& session); // nested transaction
static std::vector<pointer> getAllWithFeatures(Wt::Dbo::Session& session, boost::optional<std::size_t> limit = {}); // nested transaction
// Create utility
static pointer create(Wt::Dbo::Session& session, const boost::filesystem::path& p);