IBR-DTNSuite  0.10
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  void notify(const dtn::core::Event *evt) throw ();
52  void componentUp() throw ();
53  void componentDown() throw ();
54 
55  protected:
56  void run() throw ();
57  void __cancellation() throw ();
58 
59  private:
60  class Task
61  {
62  public:
63  virtual ~Task() {};
64  virtual std::string toString() = 0;
65  };
66 
67  class SearchNextBundleTask : public Task
68  {
69  public:
70  SearchNextBundleTask(const dtn::data::EID &eid);
71  virtual ~SearchNextBundleTask();
72 
73  virtual std::string toString();
74 
75  const dtn::data::EID eid;
76  };
77 
82  };
83  }
84 }
85 
86 #endif /* EPIDEMICROUTINGEXTENSION_H_ */