1 #ifndef VAR_LEN_TAG_HPP
2 #define VAR_LEN_TAG_HPP
13 #define VAR_LEN_TAG_ELIDE_DATA
18 #ifndef VAR_LEN_TAG_ELIDE_DATA
35 #elif !defined( MOAB_TEMPLATE_SPECIALIZATION )
84 class VarLenTagDataTemplate
87 inline VarLenTagDataTemplate() {}
97 INLINE_COUNT =
sizeof( MallocData ) -
sizeof(
unsigned )
104 unsigned char* array;
105 unsigned char pad[INLINE_COUNT -
sizeof(
unsigned char* )];
110 unsigned char array[INLINE_COUNT];
117 class VarLenTagDataTemplate< 0u >
120 inline VarLenTagDataTemplate< 0u >() {}
124 INLINE_COUNT =
sizeof(
unsigned char* )
131 unsigned char* array;
136 unsigned char array[INLINE_COUNT];
142 typedef VarLenTagDataTemplate<
sizeof(
unsigned char* ) -
sizeof(
unsigned ) > VarLenTagData;
176 #ifdef VAR_LEN_TAG_ELIDE_DATA
186 inline unsigned long mem() const
187 #ifdef VAR_LEN_TAG_ELIDE_DATA
197 inline const unsigned char*
data()
const
202 inline unsigned char*
resize(
unsigned size );
206 inline void set(
const void* dat,
unsigned sz )
208 memcpy(
resize( sz ), dat, sz );
220 #ifdef VAR_LEN_TAG_ELIDE_DATA
234 void* tmp_ptr = malloc( s );
251 #ifdef VAR_LEN_TAG_ELIDE_DATA
260 #ifdef VAR_LEN_TAG_ELIDE_DATA
271 #ifdef VAR_LEN_TAG_ELIDE_DATA
283 if( sz ) memcpy(
resize( sz ), dat, sz );