| 974 | typename Functions |
| 975 | > |
| 976 | inline void final(sqlite3_context* db) { |
| 977 | auto ctxt = static_cast<AggregateCtxt<ContextType>*>(sqlite3_aggregate_context(db, sizeof(AggregateCtxt<ContextType>))); |
| 978 | try { |
| 979 | if(!ctxt) return; |
| 980 | if(!ctxt->constructed) new(ctxt) AggregateCtxt<ContextType>(); |
| 981 | store_result_in_db(db, |
| 982 | static_cast<Functions*>(sqlite3_user_data(db))->second(ctxt->obj)); |
| 983 | } catch(sqlite_exception &e) { |
| 984 | sqlite3_result_error_code(db, e.get_code()); |
| 985 | sqlite3_result_error(db, e.what(), -1); |
| 986 | } catch(std::exception &e) { |
| 987 | sqlite3_result_error(db, e.what(), -1); |
| 988 | } catch(...) { |
| 989 | sqlite3_result_error(db, "Unknown error", -1); |
| 990 | } |
| 991 | if(ctxt && ctxt->constructed) |
| 992 | ctxt->~AggregateCtxt(); |
| 993 | } |
| 994 | |
| 995 | template< |
| 996 | std::size_t Count, |
nothing calls this directly
no test coverage detected