473,586 Members | 2,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Porting to a new compiler, that doesn't support virtual functions...

Hi all,

I have designed, implemented and tested this code, and it runs
perfectly. Now we're porting it to ARM11, and its compiler doesn't
support virtual function in compination with something that's inherent
in our application and cannot be changed.
So I have to figure out how to implement virtuality myself.

I have a base class (representing a prameter) with some derived classes
(one per paramter type). I have a container of the base class objects,
that uses virtual functions to "work" with the objects.

I tried just using a void * array with one entry per virtual function.
The population is an issue because of type converstions. Then invoking
the methods is impossible without casting to the real type. Well - I'm
in a mess.

Help, anyone?

Thanks!

Keren.

Oct 10 '05 #1
3 1157
Geo
co******@gmail. com wrote:
Hi all,

I have designed, implemented and tested this code, and it runs
What code ?
perfectly. Now we're porting it to ARM11, and its compiler doesn't
support virtual function in compination with something that's inherent
in our application and cannot be changed.
What 'something' ?

If it doesn't support virtual functions, then it's not a C++ compiler.
So I have to figure out how to implement virtuality myself.

I have a base class (representing a prameter) with some derived classes
(one per paramter type). I have a container of the base class objects,
that uses virtual functions to "work" with the objects.

I tried just using a void * array with one entry per virtual function.
The population is an issue because of type converstions. Then invoking
the methods is impossible without casting to the real type. Well - I'm
in a mess.

Help, anyone?
Get a compiler that compiles C++ code

Thanks!

Keren.


Oct 10 '05 #2
Geo wrote:
Get a compiler that compiles C++ code


while this is very true,
in C scenario you might try global funcs which accept void *my_this or
something like that.

Oct 10 '05 #3
On Mon, 10 Oct 2005 04:43:28 -0700, corner76 wrote:
Hi all,

<snip>

I tried just using a void * array with one entry per virtual function.
The population is an issue because of type converstions. Then invoking
the methods is impossible without casting to the real type. Well - I'm
in a mess.


Don't use void pointers. Use real pointer-to-member-functions, each
having the correct signature. Then initialize the pointers in the
individual constructors to point to the right member functions.

- Jay

Oct 10 '05 #4

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

Similar topics

7
2144
by: Sonny | last post by:
I need to port a library that is written entirely in C to C++. The library is supported on quite a few platforms (windows, Solaris, Linux, AIX, HP-UX, OSX, etc...) and there's quite an existing customer base that uses it. I need to maintain backwards compatibility such that existing users won't have to do anything to their existing...
4
2363
by: Chris Travers | last post by:
Hi all; A few years ago, I set about porting a PHP application from MySQL to PostgreSQL, after realizing that MySQL wasn't going to be able to handle it. In order to do this, I built a light, fast database abstraction layer which conforms to the behavior of the MySQL functions in PHP. This means that a large amount of porting work could be...
4
5722
by: r.nikhilk | last post by:
Hi, We are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by including the -q64 option in xlC compiler. But, when we link all these libraries to one of the main applications, we are getting the following errors: ld:...
55
12784
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some time ago I worked in DOS, with Borland BC++ 4.1. I do not have it any more. Which compiler would you recommend me now? Which ones support serious...
3
1911
by: Joe Van Dyk | last post by:
I'm compiling some code on a IRIX compiler (MIPSpro Compilers: Version 7.4.2m) with all warnings turned on, and I'm getting some of these warnings: cc-3649 CC: ERROR at end of source all virtual functions for class "std::__Named_exception" inline: static virtual table generated cc-3649 CC: ERROR at end of source
10
1732
by: Ivan Vecerina | last post by:
Here's a relatively simple code snippet: #include <memory> class Base { public: Base(); virtual ~Base(); virtual void f(int a, char const* name);
8
1722
by: Bern McCarty | last post by:
I have a simple ref class in its own namespace that needs to coexist with a legacy typedef alias for "unsigned int" in the global namespace that has the identifier as itself. Everything compiles fine with the old MEC++ syntax, but I cannot figure out how to write the code so that it will compile in C++/CLI. Can someone tell me how? Here is...
43
3788
by: JohnQ | last post by:
Are a default constructor, destructor, copy constructor and assignment operator generated by the compiler for a struct if they are not explicitely defined? I think the answer is yes, because "there is no difference between a struct and a class except the public/private access specification" (and a few minor other things). When I create a...
133
4151
by: Jean-Pierre Mestre | last post by:
Good evening, I have a C software for Windows that I need to port to Redhat Unix. At the moment it works completely fine with the Windows FLOSS compiler lccwin32. I try gcc but now it doesn't work :( There seems to be two serious problems, one operator overloading and the other the safe String type. Is there a compiler for Unix with these...
0
7911
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1179
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.