| 24 | |
| 25 | // This nested class is instantiated on each CREATE VIRTUAL TABLE statement. |
| 26 | class VTab { friend class CustomTable; |
| 27 | explicit VTab( |
| 28 | CustomTable* parent, |
| 29 | Napi::Function generator, |
| 30 | std::vector<std::string> parameter_names, |
| 31 | bool safe_ints |
| 32 | ) : |
| 33 | parent(parent), |
| 34 | parameter_count(parameter_names.size()), |
| 35 | safe_ints(safe_ints), |
| 36 | generator(Napi::Persistent(generator)), |
| 37 | parameter_names(parameter_names) { |
| 38 | ((void)base); |
| 39 | } |
| 40 | |
| 41 | static inline CustomTable::VTab* Upcast(sqlite3_vtab* vtab) { |
| 42 | return reinterpret_cast<VTab*>(vtab); |
| 43 | } |
| 44 | |
| 45 | inline sqlite3_vtab* Downcast() { |
| 46 | return reinterpret_cast<sqlite3_vtab*>(this); |
| 47 | } |
| 48 | |
| 49 | sqlite3_vtab base; |
| 50 | CustomTable * const parent; |
| 51 | const int parameter_count; |
| 52 | const bool safe_ints; |
| 53 | const Napi::FunctionReference generator; |
| 54 | const std::vector<std::string> parameter_names; |
| 55 | }; |
| 56 | |
| 57 | // This nested class is instantiated each time a virtual table is scanned. |
| 58 | class Cursor { friend class CustomTable; |
nothing calls this directly
no outgoing calls
no test coverage detected