Example #1
0
 internal InMemoryModelService(IRAMStorage ramStorage)
     : this(
         new TrackDao(ramStorage),
         new SubFingerprintDao(ramStorage),
         new SpectralImageDao(ramStorage),
         ramStorage)
 {
 }
Example #2
0
 private InMemoryModelService(
     ITrackDao trackDao,
     ISubFingerprintDao subFingerprintDao,
     ISpectralImageDao spectralImageDao,
     IRAMStorage ramStorage)
     : base(trackDao, subFingerprintDao, spectralImageDao)
 {
     this.ramStorage = ramStorage;
 }
Example #3
0
        private InMemoryModelService(ITrackDao trackDao, ISubFingerprintDao subFingerprintDao, ISpectralImageDao spectralImageDao, IRAMStorage ramStorage)
        {
            this.ramStorage = ramStorage;
            Id                = "in-memory-model-service";
            TrackDao          = trackDao;
            SubFingerprintDao = subFingerprintDao;
            SpectralImageDao  = spectralImageDao;

            IModelReference?lastTrackReference = null;
            uint            maxTrackId         = 0;

            if (ramStorage.Tracks.Any())
            {
                (lastTrackReference, maxTrackId) = ramStorage.Tracks.Keys
                                                   .Select(_ => (_, _.Get <uint>()))
                                                   .OrderByDescending(_ => _.Item2)
                                                   .First();
            }

            uint maxSubFingerprintId = 0;

            if (lastTrackReference != null)
            {
                maxSubFingerprintId = ramStorage
                                      .ReadSubFingerprintByTrackReference(lastTrackReference)
                                      .Max(_ => _.SubFingerprintReference.Get <uint>());
            }

            modelReferenceTracker = new UIntModelReferenceTracker(maxTrackId, maxSubFingerprintId);

            uint maxSpectralImageId = 0;

            if (lastTrackReference != null)
            {
                var spectralImages = ramStorage.GetSpectralImagesByTrackReference(lastTrackReference).ToList();
                if (spectralImages.Any())
                {
                    maxSpectralImageId = spectralImages.Max(_ => _.SpectralImageReference.Get <uint>());
                }
            }

            spectralReferenceProvider = new UIntModelReferenceProvider(maxSpectralImageId);
        }
Example #4
0
 public TrackDao(IRAMStorage storage)
 {
     this.storage = storage;
 }
Example #5
0
 public TrackDao(IRAMStorage storage)
 {
     this.storage = storage;
 }
Example #6
0
 public HashBinDao(IRAMStorage storage)
 {
     this.storage = storage;
 }
 public SubFingerprintDao(IRAMStorage storage)
 {
     this.storage = storage;
 }
 public FingerprintDao(IRAMStorage storage)
 {
     this.storage = storage;
 }
Example #9
0
 public InMemoryModelService(IRAMStorage ramStorage, IGroupingCounter groupingCounter) : this(new TrackDao(ramStorage), new SubFingerprintDao(ramStorage, groupingCounter), new SpectralImageDao(ramStorage), ramStorage)
 {
 }
Example #10
0
 public SubFingerprintDao(IRAMStorage storage, IGroupingCounter groupingCounter)
 {
     this.storage         = storage;
     this.groupingCounter = groupingCounter;
 }
Example #11
0
 public HashBinDao(IRAMStorage storage)
 {
     this.storage = storage;
 }
Example #12
0
 public SpectralImageDao(IRAMStorage ramStorage)
 {
     this.ramStorage = ramStorage;
 }
 internal SpectralImageDao(IRAMStorage ramStorage)
 {
     this.ramStorage = ramStorage;
 }
 internal SpectralImageDao(IRAMStorage ramStorage)
 {
     this.ramStorage = ramStorage;
 }