aggregatenotifier.hh

来自「COPE the first practical network coding 」· HH 代码 · 共 43 行

HH
43
字号
// -*- c-basic-offset: 4 -*-#ifndef CLICK_AGGREGATENOTIFIER_HH#define CLICK_AGGREGATENOTIFIER_HH#include <click/vector.hh>CLICK_DECLSclass Packet;class AggregateListener { public:    AggregateListener()			{ }    virtual ~AggregateListener()	{ }    enum AggregateEvent { NEW_AGG, DELETE_AGG };    virtual void aggregate_notify(uint32_t, AggregateEvent, const Packet *);    };class AggregateNotifier { public:    AggregateNotifier()			{ }    ~AggregateNotifier()		{ }    void add_listener(AggregateListener *);    void remove_listener(AggregateListener *);    void notify(uint32_t, AggregateListener::AggregateEvent, const Packet *) const;      private:    Vector<AggregateListener *> _listeners;    };inline voidAggregateNotifier::notify(uint32_t agg, AggregateListener::AggregateEvent e, const Packet *p) const{    for (int i = 0; i < _listeners.size(); i++)	_listeners[i]->aggregate_notify(agg, e, p);}CLICK_ENDDECLS#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?