hwsd  2.0.0
Local and remote ZeroConf service discovery for hardware resources
nodeInfo.h
1 
2 /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
3  * 2013, Stefan.Eilemann@epfl.ch
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef HWSD_NODEINFO_H
20 #define HWSD_NODEINFO_H
21 
22 #include <hwsd/api.h>
23 #include <servus/uint128_t.h>
24 
25 #include <ostream>
26 
27 namespace hwsd
28 {
30 struct NodeInfo
31 {
33  HWSD_API NodeInfo();
34 
36  HWSD_API bool operator==(const NodeInfo& rhs) const;
37 
39  HWSD_API bool operator!=(const NodeInfo& rhs) const;
40 
42  HWSD_API bool isLocal() const;
43 
45  HWSD_API static bool isLocal(const std::string& name);
46 
48  static std::string getLocalSession() { return "local"; }
50  servus::uint128_t id;
51 
53  std::string nodeName;
54 
56  std::string session;
57 };
58 
59 HWSD_API std::ostream& operator<<(std::ostream& os, const NodeInfo& info);
60 }
61 
62 #endif // HWSD_NODEINFO_H
NodeInfo()
Default constructor describing a local session.
Defines export visibility macros for library hwsd.
static std::string getLocalSession()
Definition: nodeInfo.h:48
std::string nodeName
System hostname if remote, empty for local.
Definition: nodeInfo.h:53
bool operator==(const NodeInfo &rhs) const
A structure containing node-specific information.
Definition: nodeInfo.h:30
std::string session
The session name: local, default or custom string.
Definition: nodeInfo.h:56
Definition: filter.h:27
bool operator!=(const NodeInfo &rhs) const
bool isLocal() const
servus::uint128_t id
Random unique ID identifing the origin node.
Definition: nodeInfo.h:50