Boost logo

Boost Users :

From: Thomas Laguzzi (tholag_at_[hidden])
Date: 2006-03-20 15:48:25


Hello there,
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>
ClassName_Ptr;
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
automatic generator.
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?

Any idea about the general problem?

Thanks & Sorry for my English!

Thomas


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net