commore  1.0.6-SNAPSHOT
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ListImpl.h File Reference
#include <new>
#include <string.h>
#include "commore/Commore.h"
#include "commore/List.h"

Go to the source code of this file.

Macros

#define CMR_LIST_IMPL(T)
 
#define CMR_LIST_IMPL_SCALAR(T)
 

Macro Definition Documentation

#define CMR_LIST_IMPL (   T)
Value:
namespace commore { \
template <> void CMREXD CmrListAllocator<T>::constructor(Byte* data, const Byte* value) \
{ \
if (value) \
{ \
new (data) T(*(T*)value); \
} else { \
new (data) T(); \
} \
} \
template <> void CMREXD CmrListAllocator<T>::destructor(Byte* data) \
{ \
((T*)data)->T::~T(); \
} \
template <> int CMREXD CmrListAllocator<T>::comparator(const Dummy& v1, const Dummy& v2) \
{ \
const T& ov1 = (const T&)v1; \
const T& ov2 = (const T&)v2; \
return ov1.compare(ov2); \
} \
}
#define CMREXD
Definition: Compiler.h:22
static int CMREXD comparator(const Dummy &v1, const Dummy &v2)
static void CMREXD constructor(Byte *data, const Byte *value)
unsigned char Byte
Definition: Type.h:64
#define CMR_LIST_IMPL_SCALAR (   T)
Value:
namespace commore { \
template <> void CMREXD CmrScalarListAllocator<T>::constructor(Byte* data, const Byte* value) \
{ \
T& v = *(T*)data; \
if (value) { \
const T& ov = *(const T*)value; \
v = ov; \
} else { \
v = 0; /*memset(data, 0,size)*/; \
} \
} \
{ \
} \
template <> int CMREXD CmrScalarListAllocator<T>::comparator(const Dummy& v1, const Dummy& v2) \
{ \
const T& ov1 = (const T&)v1; \
const T& ov2 = (const T&)v2; \
if (ov1 < ov2) return -1; \
else if (ov1 == ov2) return 0; \
else return 1; \
} \
}
static void CMREXD constructor(Byte *data, const Byte *value)
#define CMREXD
Definition: Compiler.h:22
static void CMREXD destructor(Byte *data)
static int CMREXD comparator(const Dummy &v1, const Dummy &v2)
unsigned char Byte
Definition: Type.h:64