Coverage Report

Created: 2024-04-30 09:35

src/zserio/SqliteFinalizer.h
Line
Count
Source
1
#ifndef ZSERIO_SQLITE_FINALIZER_H_INC
2
#define ZSERIO_SQLITE_FINALIZER_H_INC
3
4
#include "sqlite3.h"
5
6
namespace zserio
7
{
8
9
/**
10
 * Helper class intended to be used as a Deleter in std::unique_ptr.
11
 */
12
struct SqliteFinalizer
13
{
14
    /**
15
     * Function call operator which finalizes the given SQLite statement.
16
     *
17
     * \param ptr SQLite statement.
18
     */
19
    void operator()(sqlite3_stmt* ptr) const
20
34
    {
21
34
        sqlite3_finalize(ptr);
22
34
    }
23
};
24
25
} // namespace zserio
26
27
#endif // ZSERIO_SQLITE_FINALIZER_H_INC