Discussion:
[omniORB] How can be interface destructors compiled to be virtual
Luo Yongheng
2008-04-12 22:11:25 UTC
Permalink
I'm not familiar with omniIDL compiler. Is there any option with which compiler can make all sequence classes' destructors virtual? I found destructors for all sequences and their derived classes are non-virtual. I have many many sequence classes in my application. Non-virtual destructor makes me hard to implement some functionalities.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080413/d70b7e04/attachment.htm
Bruce Visscher
2008-04-12 23:30:29 UTC
Permalink
Why do you want to do that?

The only reason to make a destructor virtual is so you can derive from
it, allocate a derived class object on the heap via new then delete
the object using a pointer to a base class object. Sequences are not
polymorphic in nature(*), so I can't imagine a scenario in which this
would be appropriate or desirable.

I personally think it is okay to derive from classes in order to
extend the functionality in a non-polymorphic manner without making
the destructor virtual. I know this is not a universally held point
of view. I recently came across this blog:

http://bannalia.blogspot.com/2008/02/derivation-without-virtual-destructor.html

(*) I think you could design a polymorphic sequence class but I don't
believe CORBA sequences had that as a design goal.
Post by Luo Yongheng
I'm not familiar with omniIDL compiler. Is there any option with which
compiler can make all sequence classes' destructors virtual? I found
destructors for all sequences and their derived classes are non-virtual. I
have many many sequence classes in my application. Non-virtual destructor
makes me hard to implement some functionalities.
Thanks.
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
Luo Yongheng
2008-04-15 22:00:39 UTC
Permalink
Anybody has any idea?
----- Original Message -----
From: Luo Yongheng
To: omniORB-***@omniorb-support.com
Sent: Sunday, April 13, 2008 12:12 AM
Subject: [omniORB] How can be interface destructors compiled to be virtual


I'm not familiar with omniIDL compiler. Is there any option with which compiler can make all sequence classes' destructors virtual? I found destructors for all sequences and their derived classes are non-virtual. I have many many sequence classes in my application. Non-virtual destructor makes me hard to implement some functionalities.

Thanks.


------------------------------------------------------------------------------


_______________________________________________
omniORB-list mailing list
omniORB-***@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080416/8947f9d7/attachment.htm
Duncan Grisby
2008-04-18 18:06:24 UTC
Permalink
Post by Luo Yongheng
I'm not familiar with omniIDL compiler. Is there any option with which
compiler can make all sequence classes' destructors virtual? I found
destructors for all sequences and their derived classes are
non-virtual. I have many many sequence classes in my application.
Non-virtual destructor makes me hard to implement some
functionalities.
Can you explain what exactly you're trying to do? Why do you want to
derive classes from the sequence classes?

The sequence base classes are defined in
include/omniORB4/seqTemplatedecls.h, not in code generated by omniidl.

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...