hwsd  1.1.1
 All Classes Files Functions Variables Enumerations Enumerator Pages
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 <lunchbox/uint128_t.h>
24 
25 #include <ostream>
26 
27 
28 namespace hwsd
29 {
31 struct NodeInfo
32 {
34  HWSD_API NodeInfo();
35 
37  HWSD_API bool operator == ( const NodeInfo& rhs ) const;
38 
40  HWSD_API bool operator != ( const NodeInfo& rhs ) const;
41 
43  HWSD_API bool isLocal() const;
44 
46  HWSD_API static bool isLocal( const std::string& name );
47 
49  static std::string getLocalSession() { return "local"; }
50 
52  lunchbox::uint128_t id;
53 
55  std::string nodeName;
56 
58  std::string session;
59 };
60 
61 HWSD_API std::ostream& operator << ( std::ostream& os,
62  const NodeInfo& info );
63 }
64 
65 #endif // HWSD_NODEINFO_H
Defines export visibility macros for hwsd.
static std::string getLocalSession()
Definition: nodeInfo.h:49
std::string nodeName
System hostname if remote, empty for local.
Definition: nodeInfo.h:55
HWSD_API bool operator==(const NodeInfo &rhs) const
A structure containing node-specific information.
Definition: nodeInfo.h:31
std::string session
The session name: local, default or custom string.
Definition: nodeInfo.h:58
HWSD_API bool operator!=(const NodeInfo &rhs) const
HWSD_API NodeInfo()
Default constructor describing a local session.
HWSD_API bool isLocal() const
lunchbox::uint128_t id
Random unique ID identifing the origin node.
Definition: nodeInfo.h:52