Hazelcast C++ Client
Hazelcast C++ Client Library
query.cpp
1 /*
2  * Copyright (c) 2008-2022, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "hazelcast/client/query/predicates.h"
18 #include "hazelcast/client/spi/ClientContext.h"
19 
20 namespace hazelcast {
21  namespace client {
22  namespace query {
23  const char * const query_constants::KEY_ATTRIBUTE_NAME = "__key";
24  const char * const query_constants::THIS_ATTRIBUTE_NAME = "this";
25 
26  base_predicate::base_predicate(hazelcast_client &client) : out_stream(spi::ClientContext(
27  client).get_serialization_service().new_output_stream()) {}
28 
29  named_predicate::named_predicate(hazelcast_client &client, const std::string &attribute_name) : base_predicate(
30  client) {
31  out_stream.write(attribute_name);
32  }
33 
34  instance_of_predicate::instance_of_predicate(hazelcast_client &client, const std::string &java_class_name)
35  : base_predicate(client) {
36  out_stream.write(java_class_name);
37  }
38 
39  sql_predicate::sql_predicate(hazelcast_client &client, const std::string &sql)
40  : base_predicate(client) {
41  out_stream.write(sql);
42  }
43 
44  like_predicate::like_predicate(hazelcast_client &client, const std::string &attribute,
45  const std::string &expression) : named_predicate(client, attribute) {
46  out_stream.write(expression);
47  }
48 
49  ilike_predicate::ilike_predicate(hazelcast_client &client, const std::string &attribute,
50  const std::string &expression) : named_predicate(client, attribute) {
51  out_stream.write(expression);
52  }
53 
54  regex_predicate::regex_predicate(hazelcast_client &client, const std::string &attribute,
55  const std::string &expression) : named_predicate(client, attribute) {
56  out_stream.write(expression);
57  }
58 
59  true_predicate::true_predicate(hazelcast_client &client) : base_predicate(client) {}
60 
61  false_predicate::false_predicate(hazelcast_client &client) : base_predicate(client) {}
62  }
63  }
64 }
65 
ilike_predicate(hazelcast_client &client, const std::string &attribute, const std::string &expression)
Definition: query.cpp:49
like_predicate(hazelcast_client &client, const std::string &attribute, const std::string &expression)
Definition: query.cpp:44
regex_predicate(hazelcast_client &client, const std::string &attribute, const std::string &expression)
Definition: query.cpp:54
sql_predicate(hazelcast_client &client, const std::string &sql)
Definition: query.cpp:39