sptk2 logo
SPTK Home Page
QueryParameterList.h
1/*
2╔══════════════════════════════════════════════════════════════════════════════╗
3║ SIMPLY POWERFUL TOOLKIT (SPTK) ║
4╟──────────────────────────────────────────────────────────────────────────────╢
5║ copyright © 1999-2022 Alexey Parshin. All rights reserved. ║
6║ email alexeyp@gmail.com ║
7╚══════════════════════════════════════════════════════════════════════════════╝
8┌──────────────────────────────────────────────────────────────────────────────┐
9│ This library is free software; you can redistribute it and/or modify it │
10│ under the terms of the GNU Library General Public License as published by │
11│ the Free Software Foundation; either version 2 of the License, or (at your │
12│ option) any later version. │
13│ │
14│ This library is distributed in the hope that it will be useful, but │
15│ WITHOUT ANY WARRANTY; without even the implied warranty of │
16│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library │
17│ General Public License for more details. │
18│ │
19│ You should have received a copy of the GNU Library General Public License │
20│ along with this library; if not, write to the Free Software Foundation, │
21│ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. │
22│ │
23│ Please report all bugs and problems to alexeyp@gmail.com. │
24└──────────────────────────────────────────────────────────────────────────────┘
25*/
26
27#pragma once
28
29#include <sptk5/db/QueryParameter.h>
30
31#include <map>
32#include <vector>
33
34namespace sptk {
35
47using CParamVector = std::vector<SQueryParameter>;
48
56class SP_EXPORT QueryParameterList
57{
58 friend class Query;
59
60public:
64 using iterator = CParamVector::iterator;
65
69 using const_iterator = CParamVector::const_iterator;
70
76 void clear();
77
85 SQueryParameter find(const String& paramName);
86
91 void remove(size_t ndx);
92
97 QueryParameter& operator[](size_t index) const;
98
103 QueryParameter& operator[](const String& paramName) const;
104
108 size_t size() const;
109
116 void enumerate(CParamVector& params) const;
117
122 {
123 return m_items.begin();
124 }
125
130 {
131 return m_items.begin();
132 }
133
138 {
139 return m_items.end();
140 }
141
146 {
147 return m_items.end();
148 }
149
150protected:
154 void add(const SQueryParameter& item);
155
156private:
157 CParamVector m_items;
158 std::map<String, SQueryParameter> m_index;
159 bool m_bindingTypeChanged {true};
160};
161
165} // namespace sptk
Definition: QueryParameterList.h:57
const_iterator end() const
Definition: QueryParameterList.h:145
void add(const SQueryParameter &item)
const_iterator begin() const
Definition: QueryParameterList.h:129
void enumerate(CParamVector &params) const
void remove(size_t ndx)
QueryParameter & operator[](size_t index) const
CParamVector::iterator iterator
Definition: QueryParameterList.h:64
CParamVector::const_iterator const_iterator
Definition: QueryParameterList.h:69
iterator end()
Definition: QueryParameterList.h:137
QueryParameter & operator[](const String &paramName) const
iterator begin()
Definition: QueryParameterList.h:121
SQueryParameter find(const String &paramName)
Definition: QueryParameter.h:44
Definition: Query.h:239
Definition: String.h:49
std::vector< SQueryParameter > CParamVector
Definition: QueryParameterList.h:47

Fri Oct 14 2022 09:58:31: SPTK 5.4.1