473,509 Members | 11,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

visitor pattern and COM like objects ?

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

Jan 25 '06 #1
1 1522
lo************@lollisoft.de wrote:
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


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

Jan 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2344
by: Wavemaker | last post by:
I've been playing with C# v2.0 today, and having quite a bit of fun. The new version has added iterators. The iterators are coded directly into the class to be iterated. For example: public...
2
1471
by: Imre Palik | last post by:
Hi, I am trying to create a framework, that automatically generates a base class for the visitor pattern: template <typename param, typename ret = void> struct visitor { typedef ret...
12
3014
by: FluffyCat | last post by:
New on November 28, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Visitor Pattern. In the Visitor pattern, one class calls a function in another class and passes an instance of...
17
2581
by: Merlin | last post by:
Probably there is no right or wrong answer to this but I thought to ask to put my mind at rest. Ok lets say you have a object hierarchy (eg. the Glyph in Lexi from GOF book) and you want to use the...
0
1896
by: Siphiuel | last post by:
Hi everyone. When using visitor pattern, we have a nasty dependence on the types of visitable objects that is coded way on top on the visitor hierarchy. i mean, like this: class AbstractVisitor...
1
2361
by: RedLars | last post by:
Hi, Given this class definition, public class Node { Node parent; object current; ArrayList children;
1
6492
by: JosAH | last post by:
Greetings, this week we let go of all that algebraic stuff and concentrate a bit more on what object oriented programming is all about. Java claims to support OO, so why not use it? In this...
0
11598
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns: Visitor Introduction Polymorphism requires a class hierarchy where the interface to the hierarchy is in the base class. Virtual functions allow derived classes to override base...
3
1496
by: C# | last post by:
Dear Freinds, I was going through Stratergy and Visitor patterns. I am really confused. Both look same passing the logic object in to the a business object and the logic object works on the...
3
2296
by: aaragon | last post by:
Hello everyone, I've been trying to work with the visitor design pattern, and it works fine except for the following. Let's suppose that we have a fixed hierarchy of classes (many of them)...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.