Fawkes API  Fawkes Development Version
service_browse_handler.h
1 
2 /***************************************************************************
3  * service_browser.h - Webview service browser
4  *
5  * Created: Thu Jul 02 17:54:57 2009 (RoboCup 2009, Graz)
6  * Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_WEBVIEW_SERVICE_BROWSER_H_
24 #define _PLUGINS_WEBVIEW_SERVICE_BROWSER_H_
25 
26 #include <netcomm/service_discovery/browse_handler.h>
27 #include <netcomm/service_discovery/service.h>
28 
29 #include <map>
30 #include <string>
31 
32 namespace fawkes {
33 class Logger;
34 }
35 
37 {
38 public:
41 
42  virtual void all_for_now();
43  virtual void cache_exhausted();
44  virtual void browse_failed(const char *name, const char *type, const char *domain);
45  virtual void service_added(const char * name,
46  const char * type,
47  const char * domain,
48  const char * host_name,
49  const char * interface,
50  const struct sockaddr * addr,
51  const socklen_t addr_size,
52  uint16_t port,
53  std::list<std::string> &txt,
54  int flags);
55  virtual void service_removed(const char *name, const char *type, const char *domain);
56 
57  /** A map of services.
58  * Maps service names to NetworkService instances describing the service
59  * in more detail. */
60  typedef std::map<std::string, fawkes::NetworkService *> ServiceList;
61 
63 
64 private:
65  fawkes::Logger * logger_;
66  fawkes::NetworkService *webview_service_;
67  ServiceList service_list_;
68 };
69 
70 #endif
Browse handler to detect other Webview instances on the network.
virtual void browse_failed(const char *name, const char *type, const char *domain)
Failed to browse for a given service.
virtual void cache_exhausted()
Cache exhausted.
virtual void service_added(const char *name, const char *type, const char *domain, const char *host_name, const char *interface, const struct sockaddr *addr, const socklen_t addr_size, uint16_t port, std::list< std::string > &txt, int flags)
A service has been announced on the network.
WebviewServiceBrowseHandler(fawkes::Logger *logger, fawkes::NetworkService *webview_service)
Constructor.
std::map< std::string, fawkes::NetworkService * > ServiceList
A map of services.
virtual void service_removed(const char *name, const char *type, const char *domain)
A service has been removed from the network.
ServiceList & service_list()
Get the service list.
virtual void all_for_now()
All results have been retrieved.
Interface for logging.
Definition: logger.h:42
Representation of a service announced or found via service discovery (i.e.
Definition: service.h:38
Interface for class that process browse results.
Fawkes library namespace.