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());
}