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;
31 static constexpr
const char *KEY_ATTRIBUTE_NAME =
"__key";
32 static constexpr
const char *THIS_ATTRIBUTE_NAME =
"this";
55 template<
typename ...Args>
57 out_stream.write<int32_t>(
static_cast<int32_t
>(
sizeof...(values)));
58 out_stream.write_objects(values...);
61 template<
typename ...Args>
63 out_stream.write(attribute_name);
64 out_stream.write<int32_t>(
static_cast<int32_t
>(
sizeof...(values)));
65 out_stream.write_objects(values...);
69 enum struct predicate_data_serializer_hook {
76 BETWEEN_PREDICATE = 2,
80 GREATERLESS_PREDICATE = 4,
88 INSTANCEOF_PREDICATE = 8,
90 NOTEQUAL_PREDICATE = 9,
102 PAGING_PREDICATE = 15
114 out_stream.write_object(value);
127 out_stream.write_object(value);
141 bool is_equal,
bool is_less)
143 out_stream.write_object(value);
144 out_stream.write(is_equal);
145 out_stream.write(is_less);
156 template<
typename FROM_TYPE,
typename TO_TYPE>
160 out_stream.write_object(to);
161 out_stream.write_object(from);
230 template<
typename ...Args>
237 template<
typename ...Args>
243 template<
typename ...PredicateTypes>
256 namespace serialization {
263 return static_cast<int32_t
>(query::predicate_data_serializer_hook::F_ID);
271 out.append_bytes(
object.out_stream.to_byte_array());
279 BOOST_THROW_EXCEPTION(exception::hazelcast_serialization(
"readData",
280 "Client should not need to use readdata method!!!"));
290 return static_cast<int32_t
>(query::predicate_data_serializer_hook::BETWEEN_PREDICATE);
300 return static_cast<int32_t
>(query::predicate_data_serializer_hook::EQUAL_PREDICATE);
310 return static_cast<int32_t
>(query::predicate_data_serializer_hook::NOTEQUAL_PREDICATE);
321 return static_cast<int32_t
>(query::predicate_data_serializer_hook::GREATERLESS_PREDICATE);
331 return static_cast<int32_t
>(query::predicate_data_serializer_hook::FALSE_PREDICATE);
341 return static_cast<int32_t
>(query::predicate_data_serializer_hook::TRUE_PREDICATE);
351 return static_cast<int32_t
>(query::predicate_data_serializer_hook::LIKE_PREDICATE);
362 return static_cast<int32_t
>(query::predicate_data_serializer_hook::INSTANCEOF_PREDICATE);
373 return static_cast<int32_t
>(query::predicate_data_serializer_hook::SQL_PREDICATE);
383 return static_cast<int32_t
>(query::predicate_data_serializer_hook::ILIKE_PREDICATE);
393 return static_cast<int32_t
>(query::predicate_data_serializer_hook::REGEX_PREDICATE);
403 return static_cast<int32_t
>(query::predicate_data_serializer_hook::IN_PREDICATE);
413 return static_cast<int32_t
>(query::predicate_data_serializer_hook::AND_PREDICATE);
423 return static_cast<int32_t
>(query::predicate_data_serializer_hook::OR_PREDICATE);
433 return static_cast<int32_t
>(query::predicate_data_serializer_hook::NOT_PREDICATE);
440 #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 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 getClas...