 |
GridGain C++
|
Go to the documentation of this file.
23 #ifndef _IGNITE_BINARY_BINARY_TYPE
24 #define _IGNITE_BINARY_BINARY_TYPE
28 #include <ignite/common/common.h>
30 #include <ignite/impl/binary/binary_type_impl.h>
36 #define IGNITE_BINARY_TYPE_START(T) \
38 struct BinaryType<T> \
45 #define IGNITE_BINARY_TYPE_END \
52 #define IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id) \
53 static int32_t GetTypeId() \
62 #define IGNITE_BINARY_GET_TYPE_ID_AS_HASH(typeName) \
63 static int32_t GetTypeId() \
65 return GetBinaryStringHashCode(#typeName); \
72 #define IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName) \
73 static void GetTypeName(std::string& dst) \
82 #define IGNITE_BINARY_GET_FIELD_ID_AS_HASH \
83 static int32_t GetFieldId(const char* name) \
85 return GetBinaryStringHashCode(name); \
92 #define IGNITE_BINARY_IS_NULL_FALSE(T) \
93 static bool IsNull(const T&) \
102 #define IGNITE_BINARY_IS_NULL_IF_NULLPTR(T) \
103 static bool IsNull(const T& obj) \
112 #define IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T) \
113 static void GetNull(T& dst) \
122 #define IGNITE_BINARY_GET_NULL_NULLPTR(T) \
123 static void GetNull(T& dst) \
163 std::string typeName;
219 template <
typename T>
232 return BinaryTypeDereferenced::GetTypeId();
242 BinaryTypeDereferenced::GetTypeName(dst);
253 return BinaryTypeDereferenced::GetFieldId(name);
264 BinaryTypeDereferenced::Write(writer, *obj);
277 BinaryTypeDereferenced::Read(reader, *dst);
288 return !obj || BinaryTypeDereferenced::IsNull(*obj);
304 #endif //_IGNITE_BINARY_BINARY_TYPE
Binary writer.
Definition: binary_writer.h:50
Ignite API.
Definition: cache.h:47
static void GetNull(T *&dst)
Get NULL value for the given binary type.
Definition: binary_type.h:296
static void GetNull(T &dst)
Get NULL value for the given binary type.
Definition: binary_type.h:202
static int32_t GetFieldId(const char *name)
Get binary object field ID.
Definition: binary_type.h:251
Default implementations of BinaryType hashing functions and non-null type behaviour.
Definition: binary_type.h:212
BinaryType< T > BinaryTypeDereferenced
Actual type.
Definition: binary_type.h:223
Default implementations of BinaryType hashing functions.
Definition: binary_type.h:154
static int32_t GetTypeId()
Get binary object type ID.
Definition: binary_type.h:230
static void GetTypeName(std::string &dst)
Get binary object type name.
Definition: binary_type.h:240
Binary reader.
Definition: binary_reader.h:53
static bool IsNull(T *const &obj)
Check whether passed binary object should be interpreted as NULL.
Definition: binary_type.h:286
Default implementations of BinaryType methods for non-null type.
Definition: binary_type.h:185
static int32_t GetTypeId()
Get binary object type ID.
Definition: binary_type.h:161
IGNITE_IMPORT_EXPORT int32_t GetBinaryStringHashCode(const char *val)
Get binary string hash code.
Definition: binary_type.cpp:24
Binary type structure.
Definition: binary_type.h:148
static void Read(BinaryReader &reader, T *&dst)
Read binary object.
Definition: binary_type.h:273
static void Write(BinaryWriter &writer, T *const &obj)
Write binary object.
Definition: binary_type.h:262
static bool IsNull(const T &)
Check whether passed binary object should be interpreted as NULL.
Definition: binary_type.h:192
static int32_t GetFieldId(const char *name)
Get binary object field ID.
Definition: binary_type.h:175