Connecting Tech Pros Worldwide Help | Site Map

visitor pattern and COM like objects ?

  #1  
Old January 25th, 2006, 09:35 AM
lothar.behrens@lollisoft.de
Guest
 
Posts: n/a
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

  #2  
Old January 25th, 2006, 03:05 PM
mlimber
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pattern to avoid circular reference? Karthik V answers 6 December 9th, 2007 01:35 PM
Using generics in the Composite Design Pattern to avoid Boxing dave.dolan answers 14 July 20th, 2006 09:15 AM
the Visitor Design Pattern FluffyCat answers 12 December 1st, 2005 01:45 AM
how to dispatch objects depending on their class Curzio Basso answers 14 July 18th, 2005 02:41 PM