13 #define MSH_ASSERT(X) {assert(X);}
15 #define MSH_HEADER_SIZE (sizeof(int)*2)
18 #define MSH_TOTALSIZE_OFFSET (sizeof(int))
19 #define MSH_TYPECHOICE_OFFSET 0
21 #define MSH_SET_TYPECHOICE(X) { memcpy(msh_buffer+MSH_TYPECHOICE_OFFSET,&(X),sizeof(int));}
22 #define MSH_SET_TOTALSIZE(X) { memcpy(msh_buffer+MSH_TOTALSIZE_OFFSET,&(X),sizeof(int));}
23 #define MSH_GET_TYPECHOICE(X,BUF) { memcpy(&(X), ((char*)BUF)+MSH_TYPECHOICE_OFFSET,sizeof(int));}
24 #define MSH_GET_TOTALSIZE(X,BUF) { memcpy(&(X), ((char*)BUF)+MSH_TOTALSIZE_OFFSET,sizeof(int));}
30 static const int WORD_SIZE =
sizeof(long);
65 if(chIsUnmarshaling !=
'u') {
66 printf(
"MarshaledObj(void*, char): wrong argument\n");
136 msh_buffer = (
char *)realloc( msh_buffer,
msh_extent);
157 throw "Tried to marshal in object marked isUnmarshaling = true";
158 msh_currentSize = size;
162 memcpy(
msh_cursor, &msh_currentSize,
sizeof(
int));
175 msh_currentSize = size;
185 template <
class T,
class>
#define MSH_SET_TYPECHOICE(X)
const MarshaledObj & operator=(const MarshaledObj &right)
MarshaledObj(void *buf, char chIsUnmarshaling)
#define MSH_GET_TOTALSIZE(X, BUF)
static const int WORD_SIZE
void resizeBuffer(size_t new_size)
printf("%d Experimental points found\n", nlines)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define MSH_SET_TOTALSIZE(X)
void unmarshalPrimitive(void *p, int size)
static int ROUND_UP(int x)
#define MSH_GET_TYPECHOICE(X, BUF)
void marshalPrimitive(void *p, int size)
void EXTEND_BUFFER(int size)