[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Timers Constructor??????
Please read tcp.h and tcp.cc to see how it's declared and how it's
_initialized_. You can't declare it like that and instantiate it as a
global variable.
- Haobo
On Wed, 26 Apr 2000, Anis Koubaa wrote:
> Hi
> I have decalred a timer like that
> /*******************************************************************/
> class MyTimer : public TimerHandler {
> public:
> MyTimer(MyAgent *a) : TimerHandler() { a_ = a; }
> protected:
> virtual void expire(Event *e);
> MyAgent *a_;
> };
> /********************************************************************/
>
> When I declare the instance of the class of timers like it is shown in
> ns doc and either in the tcp exemple :
>
> /***************************/
> MyTimer Timer_Instance;
> /*****************************/
> the compiler tell me that there is no constructor MyTimer::MyTimer();
> there is only MyTimer::MyTimer(MyAgent* a);
> So Must I define a defalut constructor MyTimer::MyTimer() or i must
> declare the instance as follow ????
> /*************************/
> MyTimer Timer_Instance(this);
> /**************************/
> or it exist an other trick.
>
> What I Don't understant is that in the tcp agent it is defined with out
> any problem?? Why?
> ?????????
> Thank you
> --
> --------------------------------------------------------------------------
> Cordialement
>
> Koubaa Anis
> Organization : LORIA Nancy
> Equipe : RESEDAS
> Adresse : CU Haute Malgrange Vandeoeuvre Nancy Bloc C 528
> Mail : [email protected]
> Projet : Comparaison des Protocoles de cl�s de distribution de cl� de
> groupe en utilisant NS
> --------------------------------------------------------------------------
>