IBR-DTNSuite  0.12
DiscoveryBeaconHandler.h
Go to the documentation of this file.
1 /*
2  * DiscoveryBeaconHandler.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 _DISCOVERYBEACONHANDLER_H
23 #define _DISCOVERYBEACONHANDLER_H
24 
25 #include "net/DiscoveryBeacon.h"
27 #include <string>
28 
29 namespace dtn
30 {
31  namespace net
32  {
34  {
35  public:
37  {
38  public:
39  NoServiceHereException(std::string what = "No service available.") throw() : ibrcommon::Exception(what)
40  {
41  };
42 
43  virtual ~NoServiceHereException() throw() {};
44  };
45 
46  virtual ~DiscoveryBeaconHandler() = 0;
47 
48  virtual void onAdvertiseBeacon(const ibrcommon::vinterface &iface, const DiscoveryBeacon &beacon) throw ();
49 
50  virtual void onUpdateBeacon(const ibrcommon::vinterface &iface, DiscoveryBeacon &beacon) throw (NoServiceHereException);
51  };
52  }
53 }
54 
55 #endif /* _DISCOVERYBEACONHANDLER_H */
56