[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Timers Constructor??????
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
--------------------------------------------------------------------------