Connecting Tech Pros Worldwide Forums | Help | Site Map

visitor pattern and COM like objects ?

lothar.behrens@lollisoft.de
Guest
 
Posts: n/a
#1: Jan 25 '06
Hi,

I want to implement a serializiation mechanism for my classes. Having
the book Modern C++ Design
I am thinking about, if I could do it that way, the book describes.

The following conditions are given:

* My objects could be created only on heap.
* They are all derived from pure abstract classes (interfaces)
* The objects are loadable at runtime (dlsym and co)

So the sample class BaseVisitable with a static member function
AcceptImpl may be a problem
in my approach of pure virtual classes.

Are there equivalent nonstatic approaches for pure abstract classes
available ?

Thanks, Lothar


mlimber
Guest
 
Posts: n/a
#2: Jan 25 '06

re: visitor pattern and COM like objects ?


lothar.behrens@lollisoft.de wrote:[color=blue]
> Hi,
>
> I want to implement a serializiation mechanism for my classes. Having
> the book Modern C++ Design
> I am thinking about, if I could do it that way, the book describes.
>
> The following conditions are given:
>
> * My objects could be created only on heap.
> * They are all derived from pure abstract classes (interfaces)
> * The objects are loadable at runtime (dlsym and co)
>
> So the sample class BaseVisitable with a static member function
> AcceptImpl may be a problem
> in my approach of pure virtual classes.
>
> Are there equivalent nonstatic approaches for pure abstract classes
> available ?
>
> Thanks, Lothar[/color]

Check out Boost's serialization library for some ideas:

http://boost.org/libs/serialization/doc/index.html

Also, the FAQ has a section on serialization:

http://parashift.com/c++-faq-lite/serialization.html

Cheers! --M

Closed Thread