IBR-DTNSuite  0.12
FloodRoutingExtension.h
Go to the documentation of this file.
1 /*
2  * EpidemicRoutingExtension.h
3  *
4  * Copyright (C) 2011 IBR, TU Braunschweig
5  *
6  * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 
22 #ifndef FLOODROUTINGEXTENSION_H_
23 #define FLOODROUTINGEXTENSION_H_
24 
25 #include "core/Node.h"
26 
29 
30 #include <ibrdtn/data/Block.h>
31 #include <ibrdtn/data/SDNV.h>
33 
34 #include <ibrcommon/thread/Queue.h>
35 
36 #include <list>
37 #include <queue>
38 
39 namespace dtn
40 {
41  namespace routing
42  {
44  {
45  static const std::string TAG;
46 
47  public:
49  virtual ~FloodRoutingExtension();
50 
51  virtual void eventDataChanged(const dtn::data::EID &peer) throw ();
52 
53  virtual void eventBundleQueued(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta) throw ();
54 
55  void componentUp() throw ();
56  void componentDown() throw ();
57 
58  protected:
59  void run() throw ();
60  void __cancellation() throw ();
61 
62  private:
63  class Task
64  {
65  public:
66  virtual ~Task() {};
67  virtual std::string toString() = 0;
68  };
69 
70  class SearchNextBundleTask : public Task
71  {
72  public:
73  SearchNextBundleTask(const dtn::data::EID &eid);
74  virtual ~SearchNextBundleTask();
75 
76  virtual std::string toString();
77 
78  const dtn::data::EID eid;
79  };
80 
85  };
86  }
87 }
88 
89 #endif /* EPIDEMICROUTINGEXTENSION_H_ */