I'd like to thank Alan for the reply to my previous post. I'm sorry if
this message is OT. What I ask is not a technical detail, but an
opinion from you, c++ gurus :)
Finally I've setup a simply class hierarchy that derives from a common
object. Each class has:
1) Smart Pointer (boost::intrusiveptr),typedef intrusiveptr<ClassName>
2) Array of smart pointers ( typedef array <ClassName_Ptr> ClassName_Array)
Everything works fine , and I'm happy :) the framework has no depends
, it's self-contained and performant :) It is composed by a bunch of
classes, but with MANY members.
Now, I've got to make this small framework usable from:
1) .COM for compatibility
2) .NET for future applications
and of course
3) c++ and boost :)
All the three ways use the "allocate and forget about it" paradigm for
memory allocation. I only use c++ types and I don't have ANY pointer
used directly in the code.
Changing to .NET is not hard and doesn't require wrapper classes
(since the lib is self-contained), just some preprocessor programming
and recompiling. Option 3) require no change :)
What I worry about is .COM interop. Since classes are not derived from
interfaces, I would require a lot of wrappers to native classes
(because i don't want to use directly COM rules and types).
So I see two solutions:
1) ok, write these wrappers as "external" code (I have lot's of
properties and methods to wrap), maybe by using GCCXML and an
2) write base Interfaces and derive my framework classes from these,
eventually adapting intrusive_ptr to use COM AddRef's
3) use .NET to COM interop and resolve problem 1 and 2 together, but
distribuite 200MB of dll's
Anyone has experience with intrusive_ptr (or shared_ptr) and COM pointers?