1 #ifndef VTESTBED_DB_COMPARTMENTS_HH 2 #define VTESTBED_DB_COMPARTMENTS_HH 7 #include <sqlitex/forward.hh> 9 #include <vtestbed/core/types.hh> 10 #include <vtestbed/db/entity.hh> 11 #include <vtestbed/db/types.hh> 12 #include <vtestbed/geometry/types.hh> 23 using id_type = int64_t;
33 void read(sqlite::statement& in);
35 inline id_type id()
const {
return this->_id; }
36 inline void id(id_type rhs) { this->_id = rhs; }
37 inline bool has_id() {
return this->_id != 0; }
38 inline const std::string& name()
const {
return this->_name; }
39 inline void name(
const std::string& rhs) { this->_name = rhs; }
40 inline const polyhedron_type& polyhedron()
const {
return this->_geometry; }
41 inline void polyhedron(
const polyhedron_type& rhs) { this->_geometry = rhs; }
42 inline void polyhedron(
polyhedron_type&& rhs) { this->_geometry = std::move(rhs); }
48 operator>>(sqlite::statement& in,
Room<T>& rhs);
58 using vec3 = vtb::geometry::Vertex<T,3>;
59 using int3 = vtb::geometry::Vertex<int,3>;
66 using Entity::filename;
70 void import_original();
72 bool has_valid_id(sqlite::connection* db)
const;
73 bool original(sqlite::connection* db)
const;
74 void insert(sqlite::connection* db);
75 void copy(sqlite::connection* db);
76 void select(sqlite::connection* db);
77 void select_blobs(sqlite::connection* db);
78 void update(sqlite::connection* db);
79 void remove(sqlite::connection* db);
80 void save(sqlite::connection* db);
81 void read(sqlite::statement& in);
83 void install(polyhedron_type hull, T wall_thickness, T eps);
85 inline const room_array& rooms()
const {
return this->_rooms; }
86 inline void rooms(
room_array&& rhs) { this->_rooms = std::move(rhs); }
91 all(sqlite::connection* db);
95 inline room_array& rooms() {
return this->_rooms; }
96 void insert_rooms(sqlite::connection* db);
108 #endif // vim:filetype=cpp