#include <new>
#include <string.h>
#include "commore/Commore.h"
#include "commore/Array.h"
Go to the source code of this file.
#define CMR_ARRAY_IMPL |
( |
|
T | ) |
|
Value:namespace commore { \
template <>
void CMREXD CmrArrayAllocator<T>::constructor(
Byte* data,
const Byte* value) \
{ \
if (value) \
{ \
new (data) T(*(T*)value); \
} else { \
new (data) T(); \
} \
} \
template <>
void CMREXD CmrArrayAllocator<T>::destructor(
Byte* data) \
{ \
((T*)data)->T::~T(); \
} \
template <>
int CMREXD CmrArrayAllocator<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
unsigned char Byte
Definition: Type.h:64
Macro impementing array item constructor and destructor
#define CMR_ARRAY_IMPL_SCALAR |
( |
|
T | ) |
|
Value:
template <>
void CMREXD CmrScalarArrayAllocator<T>::constructor(
Byte* data,
const Byte* value) \
{ \
T& v = *(T*)data; \
if (value) { \
const T& ov = *(const T*)value; \
v = ov; \
} else { \
v = 0; ; \
} \
} \
template <>
void CMREXD CmrScalarArrayAllocator<T>::destructor(
Byte* data) \
{ \
} \
template <>
int CMREXD CmrScalarArrayAllocator<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; \
} \
}
#define CMREXD
Definition: Compiler.h:22
unsigned char Byte
Definition: Type.h:64
#define CMR_ARRAY_XML_IMPL_SCALAR(T)
Definition: ArrayImpl.h:16
Macro impementing scalar item constructor and destructor
#define CMR_ARRAY_XML_IMPL_SCALAR |
( |
|
T | ) |
|
Value:template <>
long CMREXD Array<T,CmrScalarArrayAllocator<T> >
::read_xml(IBStream& i) \
{ \
return -1; \
} \
template <>
long CMREXD Array<T,CmrScalarArrayAllocator<T> >
::write_xml(OBStream& o)
const \
{ \
return -1; \
} \
long CMREXD write_xml(const AString &sIn, OBStream &o)
Definition: AString.cpp:27
#define CMREXD
Definition: Compiler.h:22
long CMREXD read_xml(AString &sOut, IBStream &i)
Definition: AString.cpp:65
Macro implementig array xml input and output