OK, my mistake...

BaseWirelessRouting module is derived from WirelessRoutingModule, but
constructors and destructors are not inherited. (Which is a basic C++
behavior...)

Hence there is no constructor or destructor explicitly given and thus
(an empyt) one is created. This auto generated constructor obviously
does not call BaseWirelessRoutingModule::init() .

Sorry for all the fuzz...

Claus


Claus Christmann wrote:
> Hi list,
> 
> I am working with Laurent's mw-node patch
> (http://www.q2s.ntnu.no/~paquerea/ns.html) and am trying to get my own
> routing protocol to work.
> 
> Since my routing protocol utilizes several wirelss interfaces it should
> be implemented as a WirelessRoutingModule akording to Laurent's
> documentation. Unfortunately the constructor for this class seems to be
> never called. I assume that is due to the oTcl/C++ duality, which I seem
> to be unable to debug.
> 
> The code under consideration is in wireless/wireless-rtmodule.cc, lines
> 84pp:
> 
> //! Constructor
> /*! Create a new WirelessRoutingModule with an empty routing information
>     base.*/
> WirelessRoutingModule::WirelessRoutingModule()
>   : RoutingModule(),lastUid_(-1),lastRibEntry_(0)
> {
>     rib_ = new Rib();
>     init();
> }
> 
> This C++ class is used as a parent later on
> (wireless/wirelss-rtmodule.h, lines 173pp):
> 
> class BaseWirelessRoutingModule :  public WirelessRoutingModule {
> ...
> }
> 
> and BaseWirelssRoutingModule is used in the example provided with the
> patch. Unfortunately BaseWirelessRoutingModule does not do anything in
> init() (wireless/wireless-rtmodule.cc, lines 488pp)
> 
> void
> BaseWirelessRoutingModule::init()
> {
>     // nothing to do.
> }
> 
> Thus it seemes not to matter, that at least using the provided tcl
> script it seems never to be called.
> 
> Am I doing somthing wrong in gdb?
> *How is it possible that the constructor of a used class is never called?*
> 
> Has anybody any experience in coding a routing protocol for the MW-node
> patch or could point me to a source to look at?
> 
> Thanks in advance,
> 
> Claus
> 
> 

-- 
Claus Christmann
Graduate Research Assistant

Georgia Institute of Technology
270 Ferst Drive
Atlanta, GA 30332-0150

http://uav.ae.gatech.edu

Reply via email to