Collage  1.1.2
High-performance C++ library for developing object-oriented distributed applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
zeroconf.h
1 
2 /* Copyright (c) 2012-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This file is part of Collage <https://github.com/Eyescale/Collage>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef CO_ZEROCONF_H
21 #define CO_ZEROCONF_H
22 
23 #include <co/api.h>
24 #include <co/types.h>
25 
26 namespace co
27 {
28 namespace detail { class Zeroconf; }
29 
46 class Zeroconf
47 {
48 public:
50  CO_API Zeroconf( const Zeroconf& from );
51 
53  CO_API ~Zeroconf();
54 
56  CO_API Zeroconf& operator = ( const Zeroconf& rhs );
57 
67  CO_API void set( const std::string& key, const std::string& value );
68 
70  CO_API Strings getInstances() const;
71 
73  CO_API Strings getKeys( const std::string& instance ) const;
74 
76  CO_API bool containsKey( const std::string& instance,
77  const std::string& key ) const;
78 
80  CO_API const std::string& get( const std::string& instance,
81  const std::string& key ) const;
82 private:
83  Zeroconf();
84  Zeroconf( lunchbox::Servus& service );
85  friend class LocalNode;
86 
87  detail::Zeroconf* _impl;
88 };
89 }
90 #endif // CO_ZEROCONF_H
Defines export visibility macros for Collage.
CO_API Strings getKeys(const std::string &instance) const
CO_API bool containsKey(const std::string &instance, const std::string &key) const
CO_API Strings getInstances() const
A zeroconf communicator.
Definition: zeroconf.h:46
Node specialization for a local node.
Definition: localNode.h:44
CO_API ~Zeroconf()
Destruct this zeroconf communicator.
CO_API void set(const std::string &key, const std::string &value)
Set a key/value pair to be announced.
CO_API Zeroconf & operator=(const Zeroconf &rhs)
Assign the data from another zeroconf communicator.