Warning, file /sdk/codevis/thirdparty/soci/include/private/soci-autostatement.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // 0002 // Copyright (C) 2020 Vadim Zeitlin 0003 // Distributed under the Boost Software License, Version 1.0. 0004 // (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt) 0006 // 0007 0008 #ifndef SOCI_PRIVATE_SOCI_AUTOSTATEMENT_H_INCLUDED 0009 #define SOCI_PRIVATE_SOCI_AUTOSTATEMENT_H_INCLUDED 0010 0011 namespace soci 0012 { 0013 0014 namespace details 0015 { 0016 0017 // This helper class can be used with any statement backend to initialize and 0018 // cleanup a statement backend object in a RAII way. Normally this is not 0019 // needed because it's done by statement_impl, but this can be handy when using 0020 // a concrete backend inside this backend own code, see e.g. ODBC session 0021 // implementation. 0022 template <typename Backend> 0023 struct auto_statement : Backend 0024 { 0025 template <typename Session> 0026 explicit auto_statement(Session& session) 0027 : Backend(session) 0028 { 0029 this->alloc(); 0030 } 0031 0032 ~auto_statement() override 0033 { 0034 this->clean_up(); 0035 } 0036 }; 0037 0038 } // namespace details 0039 0040 } // namespace soci 0041 0042 #endif // SOCI_PRIVATE_SOCI_AUTOSTATEMENT_H_INCLUDED