[Ns-developers] A question about downcast netdevice pointer.
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Thu Sep 25 13:12:14 PDT 2008
[moving this to ns-developers to avoid bringing pointless low-level
details on ns-3-users. Please, in the future, avoid dumping all this
complexity/argumenting on ns-3-users: it serves absolutely no purpose.]
On Thu, 2008-09-25 at 12:34 -0700, craigdo at ee.washington.edu wrote:
> is and how it works. Also we need to document that, for example,
> CsmaNetDevice presents itself to the world as an aggregation of Object,
> NetDevice and CsmaNetDevice and one can maneuver around these using
This is not true. Aggregation has nothing to do here. GetObject to do a
downcast is just convenient syntactical sugar and I support gustavo's
proposal to use a DynamicCast template to avoid using it in this case
and disambiguate the usage.
We don't have COM: we have normal C++ class single inheritance with a
very simple dynamic object aggregation facility which has nothing to do
with COM. Claiming that we attempt to provide "implementation hiding"
through GetObject is just meaningless. We are not in that business
(implementation hiding) beyond trying to design good, nice, and clean
abstract base classes and that has nothing to do with object
aggregation.
If your claim is that we lack documentation about this, I agree and,
yes, I also agree that it sucks but such is life and days have a finite
number of hours and real-life priorities often make it hard to 'do the
right thing'.
regards,
Mathieu
More information about the Ns-developers
mailing list