IBR-DTNSuite  0.10
BundleSelector.h
Go to the documentation of this file.
1 /*
2  * BundleSelector.h
3  *
4  * Created on: 22.01.2013
5  * Author: morgenro
6  */
7 
8 #ifndef BUNDLESELECTOR_H_
9 #define BUNDLESELECTOR_H_
10 
11 #include "storage/BundleResult.h"
12 #include <ibrdtn/data/EID.h>
13 #include <ibrdtn/data/MetaBundle.h>
14 #include <ibrdtn/data/Number.h>
15 #include <ibrcommon/Exceptions.h>
16 
17 namespace dtn
18 {
19  namespace storage
20  {
22  {
23  public:
24  BundleSelectorException(std::string what = "Bundle query aborted.") throw() : ibrcommon::Exception(what)
25  {
26  }
27  };
28 
30  {
31  public:
32  NoBundleFoundException(std::string what = "No bundle match the specified criteria.") throw() : dtn::MissingObjectException(what)
33  {
34  };
35  };
36 
38  {
39  public:
40  virtual ~BundleSelector() {};
41 
46  virtual dtn::data::Size limit() const throw () { return 1; };
47 
54  virtual bool shouldAdd(const dtn::data::MetaBundle&) const throw (BundleSelectorException) { return false; };
55  };
56  }
57 }
58 
59 #endif /* BUNDLESELECTOR_H_ */