On Sat, 18 Jan 2003 20:55:26 +0530 Gautam Mani wrote:
As you can see in my earlier post, I am interested in knowing about implementation of plugins in C/C++. If by "dynamic class-loading in C/C++" you are referring to the dlxxx calls, let me tell you that from whatever little I have read about them, they are really not usable. They don't guarantee type-safety, and require various workarounds (atleast if you want to work with classes). Feel free to correct me if I'm wrong here.
You're half right here. Type-safety isn't guaranteed by the linking process itself, since linkers are neither supposed to know about data types, nor the language from which the object code was compiled. However, name mangling of symbols ensures that type safety is enforced for C++. This is the reason why the "extern C" artifact exists. (In fact, you can have extern foo declarations for linkage to object code from any language foo. Talk of interoperability ;-) ). The workaround you mentioned, is taken care of by the compiler without the programmer having to bother about it. In short, C++ linkage *is* type-safe.
providing type safety. I have also used its serialization capabilities for storage of message-ids etc.
If you mean Object Serialization, perhaps xparam.sourceforge.net may be the answer.