473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Multiple dispatch



Hello,

I need to implement multimethods in my program.
Can anybody point me to the literature or other
discussions of the most efficient algorithms of
performing multiple dispatch in C++?
Please DO NOT DIRECT ME to the existing libraries
that provide support for multimethods. I need
a public domain ALGORITHM or CODE that I can freely
adapt to my needs.

L.B.

*-------------------------------------------------------------------*
| Dr. Leslaw Bieniasz, |
| Institute of Physical Chemistry of the Polish Academy of Sciences,|
| Department of Electrochemical Oxidation of Gaseous Fuels, |
| ul. Zagrody 13, 30-318 Cracow, Poland. |
| tel./fax: +48 (12) 266-03-41 |
| E-mail: nb******@cyf-kr.edu.pl |
*-------------------------------------------------------------------*
| Interested in Computational Electrochemistry? |
| Visit my web site: http://www.cyf-kr.edu.pl/~nbbienia |
*-------------------------------------------------------------------*
Apr 3 '06 #1
4 1273
if you can implement your _program_ with multimethods then choose the
appropriate language that supports it. propably, CLOS (Common Lisp
Object System)

Apr 3 '06 #2
> Hello,

I need to implement multimethods in my program.
Can anybody point me to the literature or other
discussions of the most efficient algorithms of
performing multiple dispatch in C++?
Please DO NOT DIRECT ME to the existing libraries
that provide support for multimethods. I need
a public domain ALGORITHM or CODE that I can freely
adapt to my needs.


There is a nice chapter in "Modern C++ Design" from Andrei
Alexandrescu.

Regards,
Patrick

Apr 3 '06 #3
More Effective C++ has a good case study too. Read it before getting
Alexandrescu's

ko*******@gmx.de wrote:
Hello,

I need to implement multimethods in my program.
Can anybody point me to the literature or other
discussions of the most efficient algorithms of
performing multiple dispatch in C++?
Please DO NOT DIRECT ME to the existing libraries
that provide support for multimethods. I need
a public domain ALGORITHM or CODE that I can freely
adapt to my needs.


There is a nice chapter in "Modern C++ Design" from Andrei
Alexandrescu.

Regards,
Patrick


Apr 4 '06 #4

Leslaw Bieniasz wrote:
Hello,

I need to implement multimethods in my program.
Can anybody point me to the literature or other
discussions of the most efficient algorithms of
performing multiple dispatch in C++?
Please DO NOT DIRECT ME to the existing libraries
that provide support for multimethods. I need
a public domain ALGORITHM or CODE that I can freely
adapt to my needs.

L.B.


Here's some example code. I'm not sure it's anything like
what you have in mind.

struct A
{
virtual void funcB(B &b) = 0;
};

struct A1 : public A
{
virtual void funcB(B &b) { b.funcA1(*this); }
};

struct A2 : public A
{
virtual void funcB(B &b) { b.funcA2(*this); }
};

struct B
{
virtual void funcA1(A1 &a) = 0;
virtual void funcA2(A2 &a) = 0;
};

struct B1 : public B
{
virtual void funcA1(A1 &a);
virtual void funcA2(A2 &a);
};

struct B2 : public B
{
virtual void funcA1(A1 &a);
virtual void funcA2(A2 &a);
};

void foo(A &a, B &b)
{
// Calls appropriate Bx::funcAx() .
a.funcB(b);
}

Apr 4 '06 #5

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

Similar topics

0
by: Hung Jung Lu | last post by:
Hi, I try win32com.client.Dispatch('InternetExplorer.Application'), and it returns an instance of the running IE object. If there are multiple instances of IE running, how can I make sure I get...
31
by: Chris S. | last post by:
Is there a purpose for using trailing and leading double underscores for built-in method names? My impression was that underscores are supposed to imply some sort of pseudo-privatization, but would...
4
by: Leslaw Bieniasz | last post by:
Cracow, 20.09.2004 Hello, I need to implement a library containing a hierarchy of classes together with some binary operations on objects. To fix attention, let me assume that it is a...
8
by: J. Black | last post by:
Hello everyone - I've been developing an incident tracking and reporting system for an emergency services outfit that I work with part time. It's going well, except for one fly in the ointment....
6
by: G.Ashok | last post by:
Hi, Does anybody know how Multiple polymorphism can be done in VB.NET or DOT doesn't support it? Is there any third party extensions available like for Java to do this? Regards, ....Ashok...
1
by: vinoraja | last post by:
There are a number of reasons we don't implement Multiple Implementation Inheritance directly. (As you know, we support Multiple Interface Inheritance). However, I should point out that it's...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
3
by: tyler.schlosser | last post by:
Hi there, I am trying to launch a program called AmiBroker using the command: AB = win32com.client.Dispatch("Broker.Application") However, I have a dual-core CPU and would like to launch two...
3
by: Tigera | last post by:
Greetings, I too have succumbed to the perhaps foolish urge to write a video game, and I have been struggling with the implementation of multiple dispatch. I read through "More Effective C++"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.