Do you mean "compile the IMM library using the C++ compiler? In addition there are also parts of the IMM node director that ought to be converted to C++, so that we can get rid of the C<->C++ wrapper functions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only thing I can see for switching to C++ is to replace patricia tree with some other C++ structure (possibly std::map).
If you give me other advantages for switching from C to C++, I would be interested to hear them.
How do you think to get rid of wrapper functions ?
Most of wrapper functions are not just pure call of ImmModel methods.
BR,
Zoran
-----Original Message-----
From: Anders Widell [mailto:anders-w@users.sf.net]
Sent: den 27 oktober 2016 14:56
To: [opensaf:tickets]2142@tickets.opensaf.p.re.sf.net
Subject: [opensaf:tickets] #2142 imm: Use C++ for IMM library
Do you mean "compile the IMM library using the C++ compiler? In addition there are also parts of the IMM node director that ought to be converted to C++, so that we can get rid of the C<->C++ wrapper functions.
Status: accepted Milestone: 5.2.FC Created: Thu Oct 27, 2016 04:31 AM UTC by Hung Nguyen Last Updated: Thu Oct 27, 2016 04:31 AM UTC Owner: Hung Nguyen
Yes, this ticket is to use c++ compiler to complie the library and fix all the errors that c++ compiler complains since c++ compiler is stricter than c compiler.
Further enhancements like replacing patricia trees will be done in other tickets, not this one.
Changing the ticket title to avoid confusion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unless it is obvious from the example above why removing them would be a good thing, I can list some of the reasons:
The wrappper functions are just clutter - they wouldn't be needed if we use C++ all over
They cost performance and extra memory in cases like the one in the example, since it has to make a deep copy of the data structures.
The C-version of the API is more error-prone; for example there is a risk for memory leaks since you can forget to free the memory that was allocated using malloc().
The wrapper functions ought to be a pure and simple conversion between C and C++. If the wrapper function does something extra that the C++ doesn't do then there is a problem with readability - I wouldn't expect this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you mean "compile the IMM library using the C++ compiler? In addition there are also parts of the IMM node director that ought to be converted to C++, so that we can get rid of the C<->C++ wrapper functions.
Hi Anders,
The only thing I can see for switching to C++ is to replace patricia tree with some other C++ structure (possibly std::map).
If you give me other advantages for switching from C to C++, I would be interested to hear them.
How do you think to get rid of wrapper functions ?
Most of wrapper functions are not just pure call of ImmModel methods.
BR,
Zoran
-----Original Message-----
From: Anders Widell [mailto:anders-w@users.sf.net]
Sent: den 27 oktober 2016 14:56
To: [opensaf:tickets] 2142@tickets.opensaf.p.re.sf.net
Subject: [opensaf:tickets] #2142 imm: Use C++ for IMM library
Do you mean "compile the IMM library using the C++ compiler? In addition there are also parts of the IMM node director that ought to be converted to C++, so that we can get rid of the C<->C++ wrapper functions.
** [tickets:#2142] imm: Use C++ for IMM library**
Status: accepted
Milestone: 5.2.FC
Created: Thu Oct 27, 2016 04:31 AM UTC by Hung Nguyen Last Updated: Thu Oct 27, 2016 04:31 AM UTC
Owner: Hung Nguyen
Use c++ for imm library.
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/opensaf/tickets/2142/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Tickets:
#2142Yes, this ticket is to use c++ compiler to complie the library and fix all the errors that c++ compiler complains since c++ compiler is stricter than c compiler.
Further enhancements like replacing patricia trees will be done in other tickets, not this one.
Changing the ticket title to avoid confusion.
I would really like to get rid of the C<->C++ wrapper functions, that look for example like this:
Unless it is obvious from the example above why removing them would be a good thing, I can list some of the reasons:
The wrapper functions ought to be a pure and simple conversion between C and C++. If the wrapper function does something extra that the C++ doesn't do then there is a problem with readability - I wouldn't expect this.
Diff:
default (5.2)
[staging:3bd4e5]
changeset: 8432:3bd4e5b7a96d
user: Hung Nguyen hung.d.nguyen@dektech.com.au
date: Wed Nov 02 11:23:40 2016 +0700
summary: imm: Compile the IMM library using the C++ compiler [#2142]
[staging:c94117]
changeset: 8433:c9411767b601
user: Hung Nguyen hung.d.nguyen@dektech.com.au
date: Thu Dec 08 10:51:46 2016 +0700
summary: imm: Fix "crosses initialization" errors [#2142]
[staging:4b9cd9]
changeset: 8434:4b9cd9530600
user: Hung Nguyen hung.d.nguyen@dektech.com.au
date: Thu Dec 08 10:57:16 2016 +0700
summary: imm: Fix "invalid conversion" errors. [#2142]
[staging:b0317b]
changeset: 8435:b0317ba353eb
user: Hung Nguyen hung.d.nguyen@dektech.com.au
date: Thu Dec 08 10:57:39 2016 +0700
summary: imm: Fix "comparison between signed and unsigned integer" errors [#2142]
[staging:b358f6]
changeset: 8436:b358f65db262
user: Hung Nguyen hung.d.nguyen@dektech.com.au
date: Thu Dec 08 10:59:06 2016 +0700
summary: imm: Fix linkage errors [#2142]
Related
Commit: [3bd4e5]
Commit: [4b9cd9]
Commit: [b0317b]
Commit: [b358f6]
Commit: [c94117]
Tickets:
#2142