18 #include "hazelcast/client/serialization/serialization.h"
20 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
22 #pragma warning(disable : 4251)
27 class hazelcast_client;
32 static const char*
const KEY_ATTRIBUTE_NAME;
33 static const char*
const THIS_ATTRIBUTE_NAME;
55 const std::string& attribute_name);
61 template<
typename... Args>
65 out_stream.write<int32_t>(
static_cast<int32_t
>(
sizeof...(values)));
66 out_stream.write_objects(values...);
69 template<
typename... Args>
72 const Args&... values)
75 out_stream.write(attribute_name);
76 out_stream.write<int32_t>(
static_cast<int32_t
>(
sizeof...(values)));
77 out_stream.write_objects(values...);
83 const std::vector<T>& values)
86 out_stream.write(attribute_name);
87 out_stream.write<int32_t>(
static_cast<int32_t
>(values.size()));
88 for (
const T& value : values) {
89 out_stream.write_object(value);
94 enum struct predicate_data_serializer_hook
102 BETWEEN_PREDICATE = 2,
106 GREATERLESS_PREDICATE = 4,
114 INSTANCEOF_PREDICATE = 8,
116 NOTEQUAL_PREDICATE = 9,
122 REGEX_PREDICATE = 12,
124 FALSE_PREDICATE = 13,
128 PAGING_PREDICATE = 15
140 const std::string& attribute_name,
144 out_stream.write_object(value);
157 const std::string& attribute_name,
161 out_stream.write_object(value);
177 const std::string& attribute_name,
183 out_stream.write_object(value);
184 out_stream.write(is_equal);
185 out_stream.write(is_less);
197 template<
typename FROM_TYPE,
typename TO_TYPE>
199 const std::string& attribute_name,
200 const FROM_TYPE& from,
204 out_stream.write_object(to);
205 out_stream.write_object(from);
229 const std::string& java_class_name);
252 const std::string& attribute,
253 const std::string& expression);
265 const std::string& attribute,
266 const std::string& expression);
278 const std::string& attribute,
279 const std::string& expression);
290 template<
typename... Args>
292 const std::string& attribute_name,
293 const Args&... values)
304 const std::string& attribute_name,
305 const std::vector<T>& values)
313 template<
typename... Args>
322 template<
typename... PredicateTypes>
340 namespace serialization {
349 return static_cast<int32_t
>(
350 query::predicate_data_serializer_hook::F_ID);
359 out.append_bytes(
object.out_stream.to_byte_array());
368 BOOST_THROW_EXCEPTION(exception::hazelcast_serialization(
369 "readData",
"Client should not need to use readdata method!!!"));
382 return static_cast<int32_t
>(
383 query::predicate_data_serializer_hook::BETWEEN_PREDICATE);
396 return static_cast<int32_t
>(
397 query::predicate_data_serializer_hook::EQUAL_PREDICATE);
410 return static_cast<int32_t
>(
411 query::predicate_data_serializer_hook::NOTEQUAL_PREDICATE);
424 return static_cast<int32_t
>(
425 query::predicate_data_serializer_hook::GREATERLESS_PREDICATE);
438 return static_cast<int32_t
>(
439 query::predicate_data_serializer_hook::FALSE_PREDICATE);
452 return static_cast<int32_t
>(
453 query::predicate_data_serializer_hook::TRUE_PREDICATE);
466 return static_cast<int32_t
>(
467 query::predicate_data_serializer_hook::LIKE_PREDICATE);
480 return static_cast<int32_t
>(
481 query::predicate_data_serializer_hook::INSTANCEOF_PREDICATE);
494 return static_cast<int32_t
>(
495 query::predicate_data_serializer_hook::SQL_PREDICATE);
508 return static_cast<int32_t
>(
509 query::predicate_data_serializer_hook::ILIKE_PREDICATE);
522 return static_cast<int32_t
>(
523 query::predicate_data_serializer_hook::REGEX_PREDICATE);
536 return static_cast<int32_t
>(
537 query::predicate_data_serializer_hook::IN_PREDICATE);
550 return static_cast<int32_t
>(
551 query::predicate_data_serializer_hook::AND_PREDICATE);
564 return static_cast<int32_t
>(
565 query::predicate_data_serializer_hook::OR_PREDICATE);
578 return static_cast<int32_t
>(
579 query::predicate_data_serializer_hook::NOT_PREDICATE);
586 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
between_predicate(hazelcast_client &client, const std::string &attribute_name, const FROM_TYPE &from, const TO_TYPE &to)
equal_predicate(hazelcast_client &client, const std::string &attribute_name, const T &value)
greater_less_predicate(hazelcast_client &client, const std::string &attribute_name, const T &value, bool is_equal, bool is_less)
in_predicate(hazelcast_client &client, const std::string &attribute_name, const std::vector< T > &values)
The type of Args should be able to be serialized.
in_predicate(hazelcast_client &client, const std::string &attribute_name, const Args &... values)
The type of Args should be able to be serialized.
not_equal_predicate(hazelcast_client &client, const std::string &attribute_name, const T &value)
This is a marker class for Predicate classes.
static constexpr int32_t get_factory_id() noexcept
static void write_data(const T &object, object_data_output &out)
Defines how this class will be written.
static T read_data(object_data_input &in)
Should not be called at the client side!
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
static constexpr int32_t get_class_id() noexcept
Classes derived from this class should implement the following static methods: static int32_t get_cla...