DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
okssystem
include
okssystem
Host.hpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS system source for the DUNE DAQ project.
3
// Fork baseline commit: system-00-00-20 (2020-09-25).
4
// Renamed since fork: yes (from system/Host.h to include/okssystem/Host.hpp).
5
6
/*
7
* Host.h
8
* OksSystem
9
*
10
* Created by Matthias Wiesmann on 03.02.05.
11
* Copyright 2005 CERN. All rights reserved.
12
*
13
*/
14
15
#ifndef OKSSYSTEM_HOST
16
#define OKSSYSTEM_HOST
17
18
#include <netinet/in.h>
19
#include <arpa/inet.h>
20
21
#include <string>
22
#include <vector>
23
24
namespace
OksSystem
{
25
32
33
class
Host
{
34
protected
:
35
std::string
m_name
;
36
mutable
std::string
m_full_name
;
37
Host
() throw() ;
38
public:
39
static struct sockaddr_in
resolve
(const
std
::
string
&
name
) throw() ;
40
static
std
::
string
resolve
(struct sockaddr_in address) throw() ;
41
static
std
::
string
expand
(const
std
::
string
&
name
) throw() ;
42
static
std
::
string
to_string
(struct sockaddr_in ip_addr) ;
43
Host
(const
Host
&other) ;
44
Host
(const
std
::
string
&
name
);
45
Host
(struct sockaddr_in ip_addr);
46
virtual ~
Host
() throw();
47
operator struct sockaddr_in() const throw();
48
bool
equals
(const
Host
&other) const throw() ;
49
struct sockaddr_in
ip
() const throw() ;
50
const
std
::
string
&
name
() const throw() ;
51
const
std
::
string
&
full_name
() const throw() ;
52
std
::
string
ip_string
() const throw() ;
53
} ;
// Host
54
55
56
bool
operator ==(const
Host
&a, const
Host
&b) throw();
57
bool
operator !=(const
Host
&a, const
Host
&b) throw();
58
59
66
67
class
LocalHost
: public
Host
{
68
69
protected
:
70
static
LocalHost
*
s_instance
;
71
std::string
m_os_name
;
72
std::string
m_release
;
73
std::string
m_version
;
74
std::string
m_machine
;
75
mutable
std::string
m_description
;
76
public
:
77
static
const
std::string &
local_name
() throw() ;
78
static const
std
::
string
&
full_local_name
() throw() ;
79
static const
LocalHost
*
instance
() throw() ;
80
LocalHost
() throw() ;
81
~
LocalHost
() throw();
82
const
std
::
string
&
os_name
() const throw() ;
83
const
std
::
string
&
os_release
() const throw() ;
84
const
std
::
string
&
os_version
() const throw() ;
85
const
std
::
string
&
machine
() const throw() ;
86
const
std
::
string
&
description
() const throw() ;
87
88
} ;
// LocalHost
89
90
const
char
*
getfullhost
() throw() ;
91
92
bool
operator ==(const
LocalHost
&a, const
LocalHost
&b) throw();
93
bool
operator !=(const
LocalHost
&a, const
LocalHost
&b) throw();
94
95
96
}
// OksSystem
97
98
99
std
::ostream& operator<<(
std
::ostream& stream, const
OksSystem
::
Host
& host) ;
100
101
#endif
OksSystem::Host::ip_string
std::string ip_string() const
get ip in string mode
Definition
Host.cpp:177
OksSystem::Host::resolve
static struct sockaddr_in resolve(const std::string &name)
name to ip conversion
Definition
Host.cpp:37
OksSystem::Host::name
const std::string & name() const
get name
Definition
Host.cpp:154
OksSystem::Host::expand
static std::string expand(const std::string &name)
expands to full name
Definition
Host.cpp:74
OksSystem::Host::ip
struct sockaddr_in ip() const
get ip address
Definition
Host.cpp:160
OksSystem::Host::to_string
static std::string to_string(struct sockaddr_in ip_addr)
ip to string conversion
Definition
Host.cpp:86
OksSystem::Host::equals
bool equals(const Host &other) const
equality method
Definition
Host.cpp:142
OksSystem::Host::full_name
const std::string & full_name() const
get fully qualified name
Definition
Host.cpp:166
OksSystem::Host::m_name
std::string m_name
name of the host
Definition
Host.hpp:35
OksSystem::Host::Host
Host()
constructor for current host
Definition
Host.cpp:97
OksSystem::Host::m_full_name
std::string m_full_name
cached fully qualified host name
Definition
Host.hpp:36
OksSystem::LocalHost::m_os_name
std::string m_os_name
name of the operating system
Definition
Host.hpp:71
OksSystem::LocalHost::m_version
std::string m_version
version of the operating system
Definition
Host.hpp:73
OksSystem::LocalHost::description
const std::string & description() const
machine type */
Definition
Host.cpp:291
OksSystem::LocalHost::s_instance
static LocalHost * s_instance
singleton for local host
Definition
Host.hpp:70
OksSystem::LocalHost::os_release
const std::string & os_release() const
release of the operating system
Definition
Host.cpp:270
OksSystem::LocalHost::full_local_name
static const std::string & full_local_name()
fully qualified local host name
Definition
Host.cpp:216
OksSystem::LocalHost::m_machine
std::string m_machine
machine type
Definition
Host.hpp:74
OksSystem::LocalHost::os_name
const std::string & os_name() const
name of the operating system
Definition
Host.cpp:264
OksSystem::LocalHost::instance
static const LocalHost * instance()
pointer to the singleton local host
Definition
Host.cpp:226
OksSystem::LocalHost::os_version
const std::string & os_version() const
version of the operating system
Definition
Host.cpp:276
OksSystem::LocalHost::local_name
static const std::string & local_name()
localhostname
Definition
Host.cpp:207
OksSystem::LocalHost::m_release
std::string m_release
release of the operating system
Definition
Host.hpp:72
OksSystem::LocalHost::machine
const std::string & machine() const
version of the operating system
Definition
Host.cpp:282
OksSystem::LocalHost::m_description
std::string m_description
machine description (cached)
Definition
Host.hpp:75
OksSystem::LocalHost::LocalHost
LocalHost()
Definition
Host.cpp:238
OksSystem
Definition
Descriptor.hpp:22
OksSystem::getfullhost
const char * getfullhost()
get fully qualified host name
Definition
Host.cpp:307
std
Definition
SchemaUtils.hpp:118
Generated on
for DUNE-DAQ by
1.17.0