Re: dynamic casting

New Message Reply Date view Thread view Subject view Author view

Michael Boccara (boccara++at++MIT.EDU)
Tue, 15 Dec 1998 12:21:37 -0800


> pfSwitch* mySwitch = (pfSwitch*)trav->getNode();

there is absolutely nothing wrong about that line, provided that the node is
actually a pfSwitch. But if you say you *know* it, that's fine.

> How hard would
> it be to add a virtual whatAmI() meathod that wanders down the
> inheritance tree and returns this?

node->isOfType(pfSwitch::getClassType());
or
node->isExactType(pfSwitch::getClassType());

Michael->regards();

-- 
Michael Boccara  | boccara++at++mit.edu | (617) 253 0005
Massachusetts Institute of Technology  
Virtual Environment Technologies for Training
http://www.mit.edu/~boccara

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Dec 15 1998 - 09:20:24 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.