Jazz 1.25.+
Loading...
Searching...
No Matches
std_wrap.h
1/* Jazz (c) 2018-2026 kaalam.ai (The Authors of Jazz), using (under the same license):
2
3 1. Biomodelling - The AATBlockQueue class (c) Jacques BasaldĂșa, 2009-2012 licensed
4 exclusively for the use in the Jazz server software.
5
6 Copyright 2009-2012 Jacques BasaldĂșa
7
8 2. BBVA - Jazz: A lightweight analytical web server for data-driven applications.
9
10 Copyright 2016-2017 Banco Bilbao Vizcaya Argentaria, S.A.
11
12 This product includes software developed at
13
14 BBVA (https://www.bbva.com/)
15
16 3. LMDB, Copyright 2011-2017 Howard Chu, Symas Corp. All rights reserved.
17
18 Licensed under http://www.OpenLDAP.org/license.html
19
20
21 Licensed under the Apache License, Version 2.0 (the "License");
22 you may not use this file except in compliance with the License.
23 You may obtain a copy of the License at
24
25 http://www.apache.org/licenses/LICENSE-2.0
26
27 Unless required by applicable law or agreed to in writing, software
28 distributed under the License is distributed on an "AS IS" BASIS,
29 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 See the License for the specific language governing permissions and
31 limitations under the License.
32*/
33
34
35#include "src/jazz_bebop/base_api.h"
36
37#if defined CATCH_TEST
38#ifndef INCLUDED_JAZZ_CATCH2
39#define INCLUDED_JAZZ_CATCH2
40
41#include "src/catch2/catch.hpp"
42
43#endif
44#endif
45
46
47#ifndef INCLUDED_JAZZ_BEBOP_LOCATORS
48#define INCLUDED_JAZZ_BEBOP_LOCATORS
49
50
57namespace jazz_bebop
58{
59
62class stdName {
63
64 public:
65 stdName() {}
66
71 stdName(const pChar &name) {
72 strncpy(this->name, name, NAME_SIZE);
73 this->name[NAME_LENGTH] = 0;
74 }
75
81 memcpy(&this->name, &name, sizeof(stdName));
82 }
83
90 bool operator==(const stdName &o) const {
91 return strcmp(name, o.name) == 0;
92 }
93
100 bool operator<(const stdName &o) const {
101 return strcmp(name, o.name) < 0;
102 }
103
105};
106
107typedef std::vector<stdName> stdNames;
108
113
114 public:
115 stdLocator() {}
116
122 memcpy(&this->locator, &locator, sizeof(Locator));
123 }
124
130 memcpy(&this->locator, &locator, sizeof(stdLocator));
131 }
132
139 bool operator==(const stdLocator &o) const {
140 return memcmp(&locator, &o.locator, sizeof(Locator)) == 0;
141 }
142
149 bool operator<(const stdLocator &o) const {
150 return memcmp(&locator, &o.locator, sizeof(Locator)) < 0;
151 }
152
154};
155
156typedef std::vector<stdLocator> stdLocators;
157
161
162 public:
164
170 memcpy(&this->api_query_state, &api_query_state, sizeof(ApiQueryState));
171 }
172
178 memcpy(&this->api_query_state, &api_query_state, sizeof(stdAPIQueryState));
179 }
180
187 bool operator==(const stdAPIQueryState &o) const {
188 return memcmp(&api_query_state, &o.api_query_state, sizeof(ApiQueryState)) == 0;
189 }
190
197 bool operator<(const stdAPIQueryState &o) const {
198 return memcmp(&api_query_state, &o.api_query_state, sizeof(ApiQueryState)) < 0;
199 }
200
202};
203
204typedef std::vector<stdAPIQueryState> stdAPIQueryStates;
205
206typedef std::vector<String> stdUrls;
207
208} // namespace jazz_bebop
209
210#endif // ifndef INCLUDED_JAZZ_BEBOP_LOCATORS
A wrapped ApiQueryState that supports being stacked in an std::vector.
Definition std_wrap.h:160
stdAPIQueryState(const ApiQueryState &api_query_state)
Constructor from cApiQueryState.
Definition std_wrap.h:169
bool operator<(const stdAPIQueryState &o) const
Operator api_query_state < o.api_query_state.
Definition std_wrap.h:197
stdAPIQueryState(const stdAPIQueryState &api_query_state)
Copy constructor for stdAPIQueryState.
Definition std_wrap.h:177
ApiQueryState api_query_state
The API query state.
Definition std_wrap.h:201
bool operator==(const stdAPIQueryState &o) const
Operator api_query_state == o.api_query_state.
Definition std_wrap.h:187
A wrapped Locator that supports being stacked in an std::vector and used as a key in an std::map.
Definition std_wrap.h:112
bool operator==(const stdLocator &o) const
Operator locator == o.locator.
Definition std_wrap.h:139
bool operator<(const stdLocator &o) const
Operator locator < o.locator.
Definition std_wrap.h:149
stdLocator(const Locator &locator)
Constructor from cLocator.
Definition std_wrap.h:121
stdLocator(const stdLocator &locator)
Copy constructor for stdLocator.
Definition std_wrap.h:129
Locator locator
The locator.
Definition std_wrap.h:153
A wrapped Name that supports being stacked in an std::vector and used as a key in an std::map.
Definition std_wrap.h:62
bool operator==(const stdName &o) const
Operator name == o.name.
Definition std_wrap.h:90
Name name
The name.
Definition std_wrap.h:104
bool operator<(const stdName &o) const
Operator name < o.name.
Definition std_wrap.h:100
stdName(const stdName &name)
Copy constructor for stdName.
Definition std_wrap.h:80
stdName(const pChar &name)
Constructor from cChar.
Definition std_wrap.h:71
A language to access any container by base using locators.
Definition base_api.cpp:39
std::vector< stdAPIQueryState > stdAPIQueryStates
A vector of stdAPIQueryState.
Definition std_wrap.h:204
std::vector< stdName > stdNames
A vector of stdName.
Definition std_wrap.h:107
std::vector< String > stdUrls
A vector of String (an std::string)
Definition std_wrap.h:206
std::vector< stdLocator > stdLocators
A vector of stdLocator.
Definition std_wrap.h:156
char * pChar
A pointer to a char buffer.
Definition types.h:190
char Name[NAME_SIZE]
A short identifier used in Blocks, Containers and API.
Definition types.h:188
A buffer to keep the state while parsing/executing a query.
Definition base_api.h:99
Locator: A minimal structure to define the location of resources inside a Container.
Definition container.h:184