1 #ifndef VTESTBED_DB_SHIP_HH 2 #define VTESTBED_DB_SHIP_HH 6 #include <vtestbed/core/types.hh> 7 #include <vtestbed/db/compartments.hh> 8 #include <vtestbed/db/hull.hh> 20 using id_type = int64_t;
21 using int3 =
typename compartments_type::int3;
32 bool has_valid_id(sqlite::connection* db)
const;
33 void select(sqlite::connection* db);
34 void select_initial_blobs(sqlite::connection* db);
35 void select_final_blobs(sqlite::connection* db);
36 void save(sqlite::connection* db);
37 void remove(sqlite::connection* db);
38 void read(sqlite::statement& in);
40 void generate(
const int3& nrooms);
41 void install_compartments(T wall_thickness, T eps);
43 inline id_type id()
const {
return this->_id; }
44 inline void id(id_type rhs) { this->_id = rhs; }
45 inline bool has_id()
const {
return this->_id != 0; }
47 inline hull_type& hull() {
return this->_hull; }
48 inline const hull_type& hull()
const {
return this->_hull; }
52 compartments()
const {
53 return this->_compartments;
62 void insert_ship(sqlite::connection* db);
63 void update_ship(sqlite::connection* db);
69 operator>>(sqlite::statement& in,
Ship<T>& rhs);
75 #endif // vim:filetype=cpp Rigid ship with a mass and translational and angular velocity.