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

Re: Creating a Classifier from Classifier/Addr



On Mon, 12 Oct 1998 [email protected] wrote:

> I need some assistance.
> 
> I am trying to define a Classifier which acts like Classifier/Addr
> with a new "recv" function.
> 
> I want to maintain all of the Classifier/Addr functionality like
> how it deals with mask_ and shift_ , etc.  I just want to
> have access to recv().
> 
> When I try to define a new Classifier, called Classifier/ATM, 
> I lose all of the functionality of Classifier/Addr.  In particular
> the setting of mask_ and shift_ are left to what is in Classifier.
> 
> Is there some way of defining Classifier/Addr/ATM or Classifier/ATM
> such that the new classifier has everything of Addr except a new
> recv()
> 

I think Classifier/Addr doesnot have its own definition of the 'recv'
method. Try defining a dummy method in its place. Then derive yr special
classifier from class AddressClassifier and define its own recv method.

class AddressClassifier : public Classifier {
public:
	virtual void recv(Packet* p, Handler* h) {//do nothing}
....
}

class yrclassifier : public AddressClassifier {
       void recv(Packet* p, Handler* h);
}

--Padma.


> 
> Please let me know
> 
> Thanks
> 
> Shaun
> 

------------------------------------------------
Be true to your work, your word, and your friend.
--Thoreau

Padmaparna Haldar
ISI/USC.
310.822.1511 #352