| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: MIT | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | #include "LogicalPositionInfo.h" | ||
| 7 | #include "TileBaseInfo.h" | ||
| 8 | #include "ITileCoordinate.h" | ||
| 9 | #include "LogicalPositionInfo.h" | ||
| 10 | #include "IDimCoordinateQueryClause.h" | ||
| 11 | #include "ITIleInfoQueryClause.h" | ||
| 12 | #include "IBlobOutput.h" | ||
| 13 | |||
| 14 | namespace imgdoc2 | ||
| 15 | { | ||
| 16 | /// This interface is providing read-only access to the document. | ||
| 17 | class IDocQuery2d | ||
| 18 | { | ||
| 19 | public: | ||
| 20 | 160 | virtual ~IDocQuery2d() = default; | |
| 21 | |||
| 22 | /// Reads tile information for the specified tile. There are three pieces of information which can be retrieved by this method, | ||
| 23 | /// namely the tile-coordinate, the logical position and the tile-blob-info. If the respective pointers are null, the information | ||
| 24 | /// will not be retrieved. | ||
| 25 | /// If the row for the specified primary key does not exist, an exception of type "imgdoc2::non_existing_tile_exception" will be | ||
| 26 | /// thrown. | ||
| 27 | /// | ||
| 28 | /// \param idx The primary key of the tile. | ||
| 29 | /// \param [out] coordinate If non-null and the operation is successful, the tile-coordinate will be put here. | ||
| 30 | /// \param [out] info If non-null and the operation is successful, the logical position will be put here. | ||
| 31 | /// \param [out] tile_blob_info If non-null and the operation is successful, the tile-blob-info will be put here. | ||
| 32 | virtual void ReadTileInfo(imgdoc2::dbIndex idx, imgdoc2::ITileCoordinateMutate* coordinate, imgdoc2::LogicalPositionInfo* info, imgdoc2::TileBlobInfo* tile_blob_info) = 0; | ||
| 33 | |||
| 34 | /// Query the tiles table. The two query clauses are used to filter the tiles. The first clause is used to filter the tiles by their | ||
| 35 | /// coordinates, the second by other "per tile data". The functor is called for each tile which matches the query. If the functor | ||
| 36 | /// returns false, the enumeration is canceled, and no more calls to the functor will occur. The two query clauses are | ||
| 37 | /// logically ANDed together. | ||
| 38 | /// \param clause The query clause (dealing with dimension indexes). | ||
| 39 | /// \param tileInfoQuery The query clause (dealing with other "per tile data"). | ||
| 40 | /// \param func A functor which we will be called, passing in the index of tiles matching the query. If the functor returns false, the enumeration is canceled, and no | ||
| 41 | /// more calls to the functor will occur. | ||
| 42 | virtual void Query(const imgdoc2::IDimCoordinateQueryClause* clause, const imgdoc2::ITileInfoQueryClause* tileInfoQuery, const std::function<bool(imgdoc2::dbIndex)>& func) = 0; | ||
| 43 | |||
| 44 | /// Gets tiles intersecting the specified rectangle (and satisfying the other criteria). | ||
| 45 | /// \param rect The rectangle. | ||
| 46 | /// \param coordinate_clause The coordinate clause. | ||
| 47 | /// \param tileinfo_clause The tileinfo clause. | ||
| 48 | /// \param func The function. | ||
| 49 | virtual void GetTilesIntersectingRect(const imgdoc2::RectangleD& rect, const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause, const std::function<bool(imgdoc2::dbIndex)>& func) = 0; | ||
| 50 | |||
| 51 | /// Reads the tile data for the specified tile. | ||
| 52 | /// \param idx The primary key of the tile for which the tile data is to be read. | ||
| 53 | /// \param [in] data The object which is receiving the blob data. | ||
| 54 | virtual void ReadTileData(imgdoc2::dbIndex idx, imgdoc2::IBlobOutput* data) = 0; | ||
| 55 | public: | ||
| 56 | // no copy and no move (-> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-copy-move-or-destructor-function-define-or-delete-them-all ) | ||
| 57 | 80 | IDocQuery2d() = default; | |
| 58 | IDocQuery2d(const IDocQuery2d&) = delete; // copy constructor | ||
| 59 | IDocQuery2d& operator=(const IDocQuery2d&) = delete; // copy assignment | ||
| 60 | IDocQuery2d(IDocQuery2d&&) = delete; // move constructor | ||
| 61 | IDocQuery2d& operator=(IDocQuery2d&&) = delete; // move assignment | ||
| 62 | }; | ||
| 63 | } | ||
| 64 |