Apache Ignite C++
Classes | Namespaces | Macros | Functions
binary_type.h File Reference
#include <stdint.h>
#include <ignite/common/common.h>
#include <ignite/impl/binary/binary_type_impl.h>

Go to the source code of this file.

Classes

struct  ignite::binary::BinaryType< T >
 Binary type structure. More...
 
struct  ignite::binary::BinaryTypeDefaultHashing< T >
 Default implementations of BinaryType hashing functions. More...
 
struct  ignite::binary::BinaryTypeNonNullableType< T >
 Default implementations of BinaryType methods for non-null type. More...
 
struct  ignite::binary::BinaryTypeDefaultAll< T >
 Default implementations of BinaryType hashing functions and non-null type behaviour. More...
 
struct  ignite::binary::BinaryType< T * >
 BinaryType template specialization for pointers. More...
 

Namespaces

 ignite
 Apache Ignite API.
 
 ignite::binary
 Ignite Binary Objects API.
 

Macros

#define IGNITE_BINARY_TYPE_START(T)
 
#define IGNITE_BINARY_TYPE_END   };
 
#define IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id)
 
#define IGNITE_BINARY_GET_TYPE_ID_AS_HASH(typeName)
 
#define IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName)
 
#define IGNITE_BINARY_GET_FIELD_ID_AS_HASH
 
#define IGNITE_BINARY_IS_NULL_FALSE(T)
 
#define IGNITE_BINARY_IS_NULL_IF_NULLPTR(T)
 
#define IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T)
 
#define IGNITE_BINARY_GET_NULL_NULLPTR(T)
 

Functions

IGNITE_IMPORT_EXPORT int32_t ignite::binary::GetBinaryStringHashCode (const char *val)
 Get binary string hash code. More...
 

Detailed Description

Declares ignite::binary::BinaryType class template and helping macros to declare binary type specialization for user types.

Macro Definition Documentation

◆ IGNITE_BINARY_GET_FIELD_ID_AS_HASH

#define IGNITE_BINARY_GET_FIELD_ID_AS_HASH
Value:
static int32_t GetFieldId(const char* name) \
{ \
return GetBinaryStringHashCode(name); \
}

Default implementation of GetFieldId() function which returns Java-way hash code of the string.

◆ IGNITE_BINARY_GET_NULL_DEFAULT_CTOR

#define IGNITE_BINARY_GET_NULL_DEFAULT_CTOR (   T)
Value:
static void GetNull(T& dst) \
{ \
dst = T(); \
}

Implementation of GetNull() function which returns an instance created with default constructor.

◆ IGNITE_BINARY_GET_NULL_NULLPTR

#define IGNITE_BINARY_GET_NULL_NULLPTR (   T)
Value:
static void GetNull(T& dst) \
{ \
dst = 0; \
}

Implementation of GetNull() function which returns NULL pointer.

◆ IGNITE_BINARY_GET_TYPE_ID_AS_CONST

#define IGNITE_BINARY_GET_TYPE_ID_AS_CONST (   id)
Value:
static int32_t GetTypeId() \
{ \
return id; \
}

Implementation of GetTypeId() which returns predefined constant.

◆ IGNITE_BINARY_GET_TYPE_ID_AS_HASH

#define IGNITE_BINARY_GET_TYPE_ID_AS_HASH (   typeName)
Value:
static int32_t GetTypeId() \
{ \
return GetBinaryStringHashCode(#typeName); \
}

Implementation of GetTypeId() which returns hash of passed type name.

◆ IGNITE_BINARY_GET_TYPE_NAME_AS_IS

#define IGNITE_BINARY_GET_TYPE_NAME_AS_IS (   typeName)
Value:
static void GetTypeName(std::string& dst) \
{ \
dst = #typeName; \
}

Implementation of GetTypeName() which returns type name as is.

◆ IGNITE_BINARY_IS_NULL_FALSE

#define IGNITE_BINARY_IS_NULL_FALSE (   T)
Value:
static bool IsNull(const T&) \
{ \
return false; \
}

Implementation of IsNull() function which always returns false.

◆ IGNITE_BINARY_IS_NULL_IF_NULLPTR

#define IGNITE_BINARY_IS_NULL_IF_NULLPTR (   T)
Value:
static bool IsNull(const T& obj) \
{ \
return obj; \
}

Implementation of IsNull() function which return true if passed object is null pointer.

◆ IGNITE_BINARY_TYPE_END

#define IGNITE_BINARY_TYPE_END   };

End binary type definition.

◆ IGNITE_BINARY_TYPE_START

#define IGNITE_BINARY_TYPE_START (   T)
Value:
template<> \
struct BinaryType<T> \
{

Start binary type definition.

ignite::binary::GetBinaryStringHashCode
IGNITE_IMPORT_EXPORT int32_t GetBinaryStringHashCode(const char *val)
Get binary string hash code.
Definition: binary_type.cpp:25