boat
C++23 geospatial library
Loading...
Searching...
No Matches
catalog.hpp
Go to the documentation of this file.
1// Andrew Naplavkov
2
3#ifndef BOAT_DB_CATALOG_HPP
4#define BOAT_DB_CATALOG_HPP
5
6#include <boat/db/meta.hpp>
7#include <boat/db/rowset.hpp>
8#include <boat/gil.hpp>
9#include <boat/tile.hpp>
10#include <generator>
11#include <stop_token>
12
13namespace boat::db {
14
16struct catalog {
17 virtual ~catalog() = default;
18
20 virtual std::vector<source> sources() = 0;
21
22 virtual std::vector<layer> layers() = 0;
23
24 virtual table get_table( //
25 std::string_view schema_name,
26 std::string_view table_name) = 0;
27
28 virtual rowset select(table const&, page const&) = 0;
29
30 virtual rowset select(table const&, bbox const&) = 0;
31
33 virtual void insert(table const&, rowset const&, std::stop_token = {}) = 0;
34
36 virtual table create(table const&) = 0;
37
38 virtual void drop( //
39 std::string_view schema_name,
40 std::string_view table_name) = 0;
41
42 virtual raster get_raster(layer const&) = 0;
43
44 virtual std::generator<std::pair<tile, gil::any_image>> read(
45 raster,
46 std::vector<tile>) = 0;
47
49 virtual void write(raster const&, rect const&, gil::any_image_view) = 0;
50
51 virtual void set_autocommit(bool) = 0;
52
53 virtual void commit() = 0;
54};
55
56} // namespace boat::db
57
58#endif // BOAT_DB_CATALOG_HPP
Definition geometry.hpp:9
typename any_image::const_view_t any_image_view
Definition gil.hpp:51
Spatial filter for row selection.
Definition meta.hpp:70
Uniform access to vector and raster data.
Definition catalog.hpp:16
virtual std::vector< layer > layers()=0
virtual void drop(std::string_view schema_name, std::string_view table_name)=0
virtual raster get_raster(layer const &)=0
virtual rowset select(table const &, bbox const &)=0
virtual void write(raster const &, rect const &, gil::any_image_view)=0
rect coordinates are pixels.
virtual table get_table(std::string_view schema_name, std::string_view table_name)=0
virtual std::generator< std::pair< tile, gil::any_image > > read(raster, std::vector< tile >)=0
virtual void commit()=0
virtual void set_autocommit(bool)=0
virtual std::vector< source > sources()=0
May include nested data sources.
virtual ~catalog()=default
virtual void insert(table const &, rowset const &, std::stop_token={})=0
Cancellation may leave a partially inserted range.
virtual rowset select(table const &, page const &)=0
virtual table create(table const &)=0
Returns metadata reported by the backend after creation.
Definition meta.hpp:18
Pagination filter for row selection.
Definition meta.hpp:86
Definition meta.hpp:98
Definition meta.hpp:117
Definition rowset.hpp:12
Definition meta.hpp:54