IBR-DTNSuite  0.8
daemon/src/net/DiscoveryService.h
Go to the documentation of this file.
00001 /*
00002  * DiscoveryService.h
00003  *
00004  *  Created on: 11.09.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef DISCOVERYSERVICE_H_
00009 #define DISCOVERYSERVICE_H_
00010 
00011 #include <net/DiscoveryServiceProvider.h>
00012 #include <ibrcommon/net/vinterface.h>
00013 #include <stdlib.h>
00014 #include <iostream>
00015 
00016 namespace dtn
00017 {
00018         namespace net
00019         {
00020                 class DiscoveryService
00021                 {
00022                 public:
00023                         DiscoveryService();
00024                         DiscoveryService(DiscoveryServiceProvider *provider);
00025                         DiscoveryService(std::string name, std::string parameters);
00026                         virtual ~DiscoveryService();
00027 
00028                         size_t getLength() const;
00029 
00030                         std::string getName() const;
00031                         std::string getParameters() const;
00032 
00036                         void update(const ibrcommon::vinterface &net);
00037 
00038                 protected:
00039                         std::string _service_name;
00040                         std::string _service_parameters;
00041                         DiscoveryServiceProvider *_provider;
00042 
00043                 private:
00044                         friend std::ostream &operator<<(std::ostream &stream, const DiscoveryService &service);
00045                         friend std::istream &operator>>(std::istream &stream, DiscoveryService &service);
00046                 };
00047         }
00048 }
00049 
00050 #endif /* DISCOVERYSERVICE_H_ */