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 const char *
const KEY_ATTRIBUTE_NAME;
32 static const char *
const THIS_ATTRIBUTE_NAME;
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...);
70 out_stream.write(attribute_name);
71 out_stream.write<int32_t>(
static_cast<int32_t
>(values.size()));
72 for (
const T &value : values) {
73 out_stream.write_object(value);
78 enum struct predicate_data_serializer_hook {
85 BETWEEN_PREDICATE = 2,
89 GREATERLESS_PREDICATE = 4,
97 INSTANCEOF_PREDICATE = 8,
99 NOTEQUAL_PREDICATE = 9,
105 REGEX_PREDICATE = 12,
107 FALSE_PREDICATE = 13,
111 PAGING_PREDICATE = 15
123 out_stream.write_object(value);
136 out_stream.write_object(value);
150 bool is_equal,
bool is_less)
152 out_stream.write_object(value);
153 out_stream.write(is_equal);
154 out_stream.write(is_less);
165 template<
typename FROM_TYPE,
typename TO_TYPE>
169 out_stream.write_object(to);
170 out_stream.write_object(from);
239 template<
typename ...Args>
255 template<
typename ...Args>
261 template<
typename ...PredicateTypes>
274 namespace serialization {
281 return static_cast<int32_t
>(query::predicate_data_serializer_hook::F_ID);
289 out.append_bytes(
object.out_stream.to_byte_array());
297 BOOST_THROW_EXCEPTION(exception::hazelcast_serialization(
"readData",
298 "Client should not need to use readdata method!!!"));
308 return static_cast<int32_t
>(query::predicate_data_serializer_hook::BETWEEN_PREDICATE);
318 return static_cast<int32_t
>(query::predicate_data_serializer_hook::EQUAL_PREDICATE);
328 return static_cast<int32_t
>(query::predicate_data_serializer_hook::NOTEQUAL_PREDICATE);
339 return static_cast<int32_t
>(query::predicate_data_serializer_hook::GREATERLESS_PREDICATE);
349 return static_cast<int32_t
>(query::predicate_data_serializer_hook::FALSE_PREDICATE);
359 return static_cast<int32_t
>(query::predicate_data_serializer_hook::TRUE_PREDICATE);
369 return static_cast<int32_t
>(query::predicate_data_serializer_hook::LIKE_PREDICATE);
380 return static_cast<int32_t
>(query::predicate_data_serializer_hook::INSTANCEOF_PREDICATE);
391 return static_cast<int32_t
>(query::predicate_data_serializer_hook::SQL_PREDICATE);
401 return static_cast<int32_t
>(query::predicate_data_serializer_hook::ILIKE_PREDICATE);
411 return static_cast<int32_t
>(query::predicate_data_serializer_hook::REGEX_PREDICATE);
421 return static_cast<int32_t
>(query::predicate_data_serializer_hook::IN_PREDICATE);
431 return static_cast<int32_t
>(query::predicate_data_serializer_hook::AND_PREDICATE);
441 return static_cast<int32_t
>(query::predicate_data_serializer_hook::OR_PREDICATE);
451 return static_cast<int32_t
>(query::predicate_data_serializer_hook::NOT_PREDICATE);
458 #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 getClas...