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/service.h>
27 #include <netcomm/service_discovery/browse_handler.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,
45  const char *type,
46  const char *domain);
47  virtual void service_added(const char *name,
48  const char *type,
49  const char *domain,
50  const char *host_name,
51  const char *interface,
52  const struct sockaddr *addr,
53  const socklen_t addr_size,
54  uint16_t port,
55  std::list<std::string> &txt,
56  int flags);
57  virtual void service_removed(const char *name,
58  const char *type,
59  const char *domain);
60 
61  /** A map of services.
62  * Maps service names to NetworkService instances describing the service
63  * in more detail. */
64  typedef std::map<std::string, fawkes::NetworkService *> ServiceList;
65 
66  ServiceList & service_list();
67 
68  private:
69  fawkes::Logger *__logger;
70  fawkes::NetworkService *__webview_service;
71  ServiceList __service_list;
72 };
73 
74 #endif
Fawkes library namespace.
Interface for class that process browse results.
Representation of a service announced or found via service discovery (i.e.
Definition: service.h:37
Browse handler to detect other Webview instances on the network.
std::map< std::string, fawkes::NetworkService * > ServiceList
A map of services.
Interface for logging.
Definition: logger.h:34