29 #ifndef INFINISQLMBOX_H
30 #define INFINISQLMBOX_H
85 static uint64_t
getCount(__int128 i128);
158 Mboxes(int64_t nodeidarg);
265 #define REUSEMESSAGES class Message reuseMessage; \
266 class MessageSocket reuseMessageSocket; \
267 class MessageUserSchema reuseMessageUserSchema; \
268 class MessageDeadlock reuseMessageDeadlock; \
269 class MessageSubtransactionCmd reuseMessageSubtransactionCmd; \
270 class MessageCommitRollback reuseMessageCommitRollback; \
271 class MessageDispatch reuseMessageDispatch; \
272 class MessageAckDispatch reuseMessageAckDispatch; \
273 class MessageApply reuseMessageApply; \
274 class MessageAckApply reuseMessageAckApply;
277 #define GETMSG(X, Y, Z) \
279 if (X != NULL && X->messageStruct.topic==TOPIC_SERIALIZED) \
281 SerializedMessage serobj(((class MessageSerialized *)X)->data); \
282 switch (serobj.getpayloadtype()) \
284 case PAYLOADMESSAGE: \
286 reuseMessage=Message(); \
287 reuseMessage.unpack(serobj); \
288 if (serobj.data->size() != serobj.pos) \
290 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
295 case PAYLOADSOCKET: \
297 reuseMessageSocket=MessageSocket(); \
298 reuseMessageSocket.unpack(serobj); \
299 if (serobj.data->size() != serobj.pos) \
301 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
303 X=&reuseMessageSocket; \
306 case PAYLOADUSERSCHEMA: \
308 reuseMessageUserSchema=MessageUserSchema(); \
309 reuseMessageUserSchema.unpack(serobj); \
310 if (serobj.data->size() != serobj.pos) \
312 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
314 X=&reuseMessageUserSchema; \
317 case PAYLOADDEADLOCK: \
319 reuseMessageDeadlock=MessageDeadlock(); \
320 reuseMessageDeadlock.unpack(serobj); \
321 if (serobj.data->size() != serobj.pos) \
323 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
325 X=&reuseMessageDeadlock; \
328 case PAYLOADSUBTRANSACTION: \
330 reuseMessageSubtransactionCmd=MessageSubtransactionCmd(); \
331 reuseMessageSubtransactionCmd.unpack(serobj); \
332 if (serobj.data->size() != serobj.pos) \
334 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
336 X=&reuseMessageSubtransactionCmd; \
339 case PAYLOADCOMMITROLLBACK: \
341 reuseMessageCommitRollback=MessageCommitRollback(); \
342 reuseMessageCommitRollback.unpack(serobj); \
343 if (serobj.data->size() != serobj.pos) \
345 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
347 X=&reuseMessageCommitRollback; \
350 case PAYLOADDISPATCH: \
352 reuseMessageDispatch=MessageDispatch(); \
353 reuseMessageDispatch.unpack(serobj); \
354 if (serobj.data->size() != serobj.pos) \
356 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
358 X=&reuseMessageDispatch; \
361 case PAYLOADACKDISPATCH: \
363 reuseMessageAckDispatch=MessageAckDispatch(); \
364 reuseMessageAckDispatch.unpack(serobj); \
365 if (serobj.data->size() != serobj.pos) \
367 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
369 X=&reuseMessageAckDispatch; \
374 reuseMessageApply=MessageApply(); \
375 reuseMessageApply.unpack(serobj); \
376 if (serobj.data->size() != serobj.pos) \
378 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
380 X=&reuseMessageApply; \
383 case PAYLOADACKAPPLY: \
385 reuseMessageAckApply=MessageAckApply(); \
386 reuseMessageAckApply.unpack(serobj); \
387 if (serobj.data->size() != serobj.pos) \
389 fprintf(logfile, "unpack %i size %lu pos %lu\n", serobj.getpayloadtype(), serobj.data->size(), serobj.pos); \
391 X=&reuseMessageAckApply; \
395 printf("%s %i anomaly %i\n", __FILE__, __LINE__, serobj.getpayloadtype()); \
397 delete serobj.data; \