[Click] dynamic_cast ?

Michael Neufeld mneufeld at bbn.com
Thu Nov 5 08:49:21 EST 2009


Last time I looked Linux kernel mode Click disables RTTI (as well as 
exceptions), so I wouldn't expect dynamic_cast to work in the Linux kernel.

-Mike

Harald Schiöberg wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> does anyone know whether this is safe to do in click ?
> 
> class Foo : public Element { ... }
> class FooBar : public Foo { ... }
> 
> Foo::some_method() {
>     Element downstream;
>     downstream  = output[0].element();
> 
>     if ( dynamic_cast<Foo>(e) ) {
> 	... e is a foo ...
>     } else {
> 	.... e is not a foo ...
>     }
> }
> 
> I currently have no linuxkernel installation, so I can't check for this
> case, but I see potential breakage, since this requires a bit of
> compiler magic.
> 
> - --
> Harald Schiöberg
> Technische Universität Berlin | T-Laboratories | FG INET
> www: http://www.net.t-labs.tu-berlin.de
> Phone: +49-(0)30-8353-58476 | Fax: +49-(0)391 534 783 47
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFK8seMy8wrZ9OvkU0RAhuhAJ0eYpMbgkXBKCOHpwThJhAIrz+AxwCfYWmn
> /6Ym0puh/5mvuSVz6OwYvuc=
> =2o3a
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> 

-- 
*************************
Michael J. Neufeld, Ph.D.
Network Scientist
BBN Technologies
10 Moulton St.
Cambridge, MA 02138
mneufeld at bbn.com
617-873-1898
http://www.bbn.com
**************************


More information about the click mailing list