I'm using a C++ based framework which is based on rewriting rules. The individual rewriting rules are coded by developers like me. The parameters in the interface of the rewriting rules can be defined with any typed variables. What the framework appears to do is to apply a memcpy to all parameters when applying the rewriting rules.
Now I use instances of C++ objects (with somewhat complex inheritance from multiple abstract classes) as parameters of my rewriting rules. Not surprisingly, the memcpy is only partially successful and after the rewriting rule is applied, many members of my objects are messed up. In particular, pointer, map and vector members are messed up.
From what I read up I understand that memcpy is a fairly low-level copy mechanism. I was wondering if there was any way I could help fix the mess happening during memcpy? For example, if I defined copy constructors for all my classes - would memcpy be able to make use of them? Sorry in case this is a silly question.
(In case there is no way to make memcpy work for complex instances then I would conclude that the framework I have been working with is not suitable for passing objects)