include
warehouse_ros_sqlite
result_iteration_helper.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-3-Clause
2
3
/*
4
* Copyright (c) 2020, Bjarne von Horn
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are met:
9
* * Redistributions of source code must retain the above copyright notice,
10
* this list of conditions and the following disclaimer.
11
* * Redistributions in binary form must reproduce the above copyright notice,
12
* this list of conditions and the following disclaimer in the documentation
13
* and/or other materials provided with the distribution.
14
* * Neither the name of the copyright holder nor the names of its contributors
15
* may be used to endorse or promote products derived from this software
16
* without specific prior written permission.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
* ARE DISCLAIMED. IN NO EVENT SHALL BJARNE VON HORN BE LIABLE FOR ANY DIRECT,
22
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
*/
29
#pragma once
30
31
#include <
warehouse_ros/query_results.h
>
32
#include <
warehouse_ros_sqlite/utils.h
>
33
#include <warehouse_ros_sqlite/warehouse_ros_sqlite_export.h>
34
35
namespace
warehouse_ros_sqlite
36
{
37
class
WAREHOUSE_ROS_SQLITE_EXPORT
ResultIteratorHelper
:
public
warehouse_ros::ResultIteratorHelper
38
{
39
sqlite3_stmt_ptr
stmt_
;
40
std::vector<std::pair<std::string, int>>
metadata_cols_
;
41
void
initMetadataCols();
42
43
public
:
44
ResultIteratorHelper
() =
default
;
45
ResultIteratorHelper
(
sqlite3_stmt_ptr
stmt) : stmt_(
std
::move(stmt))
46
{
47
initMetadataCols();
48
}
49
bool
next()
override
;
50
bool
hasData()
const override
;
51
warehouse_ros::Metadata::ConstPtr
metadata()
const override
;
52
std::string message()
const override
;
53
};
54
55
}
// namespace warehouse_ros_sqlite
warehouse_ros_sqlite
Definition:
database_connection.h:36
boost::shared_ptr< const Metadata >
warehouse_ros::ResultIteratorHelper
warehouse_ros_sqlite::ResultIteratorHelper
Definition:
result_iteration_helper.h:37
utils.h
warehouse_ros_sqlite::sqlite3_stmt_ptr
std::unique_ptr< sqlite3_stmt, Sqlite3StmtDeleter > sqlite3_stmt_ptr
Definition:
utils.h:50
warehouse_ros_sqlite::ResultIteratorHelper::metadata_cols_
std::vector< std::pair< std::string, int > > metadata_cols_
Definition:
result_iteration_helper.h:40
query_results.h
warehouse_ros_sqlite::ResultIteratorHelper::ResultIteratorHelper
ResultIteratorHelper(sqlite3_stmt_ptr stmt)
Definition:
result_iteration_helper.h:45
warehouse_ros_sqlite::ResultIteratorHelper::stmt_
sqlite3_stmt_ptr stmt_
Definition:
result_iteration_helper.h:39
std
warehouse_ros_sqlite
Author(s): Bjarne von Horn
autogenerated on Mon Oct 14 2024 02:16:58