1 #ifndef macro_HEADER_GUARD
2 #define macro_HEADER_GUARD
37 #define ban_copy_ctor(CLASS) \
38 CLASS(const CLASS &f) {\
39 std::cout << "FATAL: copy-construction prohibited for this class" << std::endl;\
40 perror("FATAL: copy-construction prohibited for this class");\
44 #define ban_copy_asm(CLASS) \
45 CLASS &operator= (const CLASS &f) {\
46 std::cout << "FATAL: copy assignment prohibited for this class" << std::endl;\
47 perror("FATAL: copy assignment prohibited for this class");\
51 #define notice_ban_copy_ctor() \
53 std::cout << "FATAL: copy-construction prohibited for this class" << std::endl;\
54 perror("FATAL: copy-construction prohibited for this class");\
63 #define frame_essentials(CLASSNAME, CLASS) \
64 virtual FrameClass getFrameClass() {\
67 virtual void copyFrom(Frame *f) {\
69 cf=dynamic_cast<CLASS*>(f);\
71 perror("FATAL : invalid cast at copyFrom");\
76 CLASS(const CLASS &f) {\
77 std::cout << "FATAL: copy-construction prohibited for frame classes" << std::endl;\
78 perror("FATAL: copy-construction prohibited for frame classes");\
82 #define frame_clone(CLASSNAME, CLASS) \
83 virtual CLASS *getClone() {\
84 CLASS *tmpframe = new CLASS();\
108 #define get_signal_context(SIGNALFRAME, CONTEXT) \
109 memcpy((void*)&CONTEXT, (void*)((SIGNALFRAME)->signal_ctx_buf.data()), sizeof(CONTEXT));\
111 #define put_signal_context(SIGNALFRAME, CONTEXT, CONTEXT_NUM) \
112 (SIGNALFRAME)->signal_ctx_buf.resize(sizeof(CONTEXT));\
113 memcpy((void*)((SIGNALFRAME)->signal_ctx_buf.data()), (void*)&CONTEXT, sizeof(CONTEXT));\
114 (SIGNALFRAME)->signaltype=CONTEXT_NUM;\
118 #define handle_error(msg) \
119 do { perror(msg); exit(EXIT_FAILURE); } while (0)