IBR-DTNSuite  0.10
EpidemicRoutingExtension.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 EPIDEMICROUTINGEXTENSION_H_
23 #define EPIDEMICROUTINGEXTENSION_H_
24 
25 #include "core/Node.h"
26 #include "core/AbstractWorker.h"
27 
30 
31 #include <ibrdtn/data/Block.h>
32 #include <ibrdtn/data/SDNV.h>
35 
36 #include <ibrcommon/thread/Queue.h>
38 
39 #include <list>
40 #include <queue>
41 
42 namespace dtn
43 {
44  namespace routing
45  {
47  {
48  static const std::string TAG;
49 
50  public:
52  virtual ~EpidemicRoutingExtension();
53 
54  void notify(const dtn::core::Event *evt) throw ();
55  void componentUp() throw ();
56  void componentDown() throw ();
57 
61  virtual void requestHandshake(const dtn::data::EID&, NodeHandshake&) const;
62 
63  protected:
64  void run() throw ();
65  void __cancellation() throw ();
66 
67  private:
68  class Task
69  {
70  public:
71  virtual ~Task() {};
72  virtual std::string toString() = 0;
73  };
74 
75  class SearchNextBundleTask : public Task
76  {
77  public:
78  SearchNextBundleTask(const dtn::data::EID &eid);
79  virtual ~SearchNextBundleTask();
80 
81  virtual std::string toString();
82 
83  const dtn::data::EID eid;
84  };
85 
90  };
91  }
92 }
93 
94 #endif /* EPIDEMICROUTINGEXTENSION_H_ */