-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented staged and temporal query support. (#6)
Implemented structures and convenience methods for staged and temporal queries.
- Loading branch information
Showing
5 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/TemporalQueryResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Org.Vitrivr.CineastApi.Model; | ||
using Vitrivr.UnityInterface.CineastApi.Model.Registries; | ||
|
||
namespace Vitrivr.UnityInterface.CineastApi.Model.Data | ||
{ | ||
public class TemporalQueryResponse | ||
{ | ||
public readonly TemporalQuery Query; | ||
public readonly TemporalQueryResult Results; | ||
|
||
public TemporalQueryResponse(TemporalQuery query, TemporalQueryResult results) | ||
{ | ||
Query = query; | ||
Results = results; | ||
} | ||
|
||
public async Task Prefetch(int number) | ||
{ | ||
var segmentSet = Results.Content.Take(number) | ||
.SelectMany(result => result.Segments | ||
.Select(SegmentRegistry.GetSegment) | ||
).ToHashSet(); | ||
|
||
await SegmentRegistry.BatchFetchSegmentData(segmentSet.ToList()); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/TemporalQueryResponse.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters