bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help for cpp code


From: taraben . a
Subject: Re: help for cpp code
Date: Tue, 23 Dec 2003 18:52:03 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4

Hi Dheerendra Kulkarni,

your problem is not related to CommonCpp it is related to C++ itself.
You should look at "Stroustroup, The C++ Programming Language" Section Classes. After the ":" on the declaration (not definition) you can write member constructors of this class constructor. This constructors will be called in the order left to right before the body of the constructor.
So for for your ex:
NRLOLSR::NRLOLSR(nsaddr_t id) : Agent(PT_NRLOLSR),htimer(this), ttimer(this)
call Agent(PT_NRLOLSR)
call htimer(this)
call ttimer(this)
call NRLOLSR(nsaddr_t id)

HTH,

Adib.   

Dheerendra Kulkarni wrote:
Please help me in what this code means

NRLOLSR::NRLOLSR(nsaddr_t id) : Agent(PT_NRLOLSR),htimer(this), ttimer(this)
{
...
..
..
..

};

This is actually a constructor for a class called NRLOLSR now I don't
Understand what does literals following ':' mean (will they call functions
which are given there or what)
Dheerendra Kulkarni


-----------------------------------------
This email was sent from NITK Surathkal
   "Webmail "
http://krec.ac.in/




_______________________________________________
Bug-commoncpp mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/bug-commoncpp





reply via email to

[Prev in Thread] Current Thread [Next in Thread]