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 <arpa/inet.h>
19
#include <netinet/in.h>
20
21
#include <string>
22
#include <vector>
23
24
namespace
OksSystem
{
25
32
33
class
Host
34
{
35
protected
:
36
std::string
m_name
;
37
mutable
std::string
m_full_name
;
38
Host
() throw();
39
public:
40
static struct sockaddr_in
resolve
(const
std
::
string
&
name
) throw();
41
static
std
::
string
resolve
(struct sockaddr_in address) throw();
42
static
std
::
string
expand
(const
std
::
string
&
name
) throw();
43
static
std
::
string
to_string
(struct sockaddr_in ip_addr);
44
Host
(const
Host
& other);
45
Host
(const
std
::
string
&
name
);
46
Host
(struct sockaddr_in ip_addr);
47
virtual ~
Host
() throw();
48
operator struct sockaddr_in() const throw();
49
bool
equals
(const
Host
& other) const throw();
50
struct sockaddr_in
ip
() const throw();
51
const
std
::
string
&
name
() const throw();
52
const
std
::
string
&
full_name
() const throw();
53
std
::
string
ip_string
() const throw();
54
};
// Host
55
56
bool
57
operator==(const
Host
& a, const
Host
& b) throw();
58
bool
59
operator!=(const
Host
& a, const
Host
& b) throw();
60
67
68
class
LocalHost
: public
Host
69
{
70
71
protected
:
72
static
LocalHost
*
s_instance
;
73
std::string
m_os_name
;
74
std::string
m_release
;
75
std::string
m_version
;
76
std::string
m_machine
;
77
mutable
std::string
m_description
;
78
public
:
79
static
const
std::string&
local_name
() throw();
80
static const
std
::
string
&
full_local_name
() throw();
81
static const
LocalHost
*
instance
() throw();
82
LocalHost
() throw();
83
~
LocalHost
() throw();
84
const
std
::
string
&
os_name
() const throw();
85
const
std
::
string
&
os_release
() const throw();
86
const
std
::
string
&
os_version
() const throw();
87
const
std
::
string
&
machine
() const throw();
88
const
std
::
string
&
description
() const throw();
89
90
};
// LocalHost
91
92
const
char
*
93
getfullhost
() throw();
94
95
bool
96
operator==(const
LocalHost
& a, const
LocalHost
& b) throw();
97
bool
98
operator!=(const
LocalHost
& a, const
LocalHost
& b) throw();
99
100
}
// OksSystem
101
102
std
::ostream&
103
operator<<(
std
::ostream& stream, const
OksSystem
::
Host
& host);
104
105
#endif
OksSystem::Host::ip_string
std::string ip_string() const
get ip in string mode
Definition
Host.cpp:198
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:165
OksSystem::Host::expand
static std::string expand(const std::string &name)
expands to full name
Definition
Host.cpp:79
OksSystem::Host::ip
struct sockaddr_in ip() const
get ip address
Definition
Host.cpp:175
OksSystem::Host::to_string
static std::string to_string(struct sockaddr_in ip_addr)
ip to string conversion
Definition
Host.cpp:94
OksSystem::Host::equals
bool equals(const Host &other) const
equality method
Definition
Host.cpp:152
OksSystem::Host::full_name
const std::string & full_name() const
get fully qualified name
Definition
Host.cpp:185
OksSystem::Host::m_name
std::string m_name
name of the host
Definition
Host.hpp:36
OksSystem::Host::Host
Host()
constructor for current host
Definition
Host.cpp:106
OksSystem::Host::m_full_name
std::string m_full_name
cached fully qualified host name
Definition
Host.hpp:37
OksSystem::LocalHost::m_os_name
std::string m_os_name
name of the operating system
Definition
Host.hpp:73
OksSystem::LocalHost::m_version
std::string m_version
version of the operating system
Definition
Host.hpp:75
OksSystem::LocalHost::description
const std::string & description() const
machine type */
Definition
Host.cpp:333
OksSystem::LocalHost::s_instance
static LocalHost * s_instance
singleton for local host
Definition
Host.hpp:72
OksSystem::LocalHost::os_release
const std::string & os_release() const
release of the operating system
Definition
Host.cpp:306
OksSystem::LocalHost::full_local_name
static const std::string & full_local_name()
fully qualified local host name
Definition
Host.cpp:243
OksSystem::LocalHost::m_machine
std::string m_machine
machine type
Definition
Host.hpp:76
OksSystem::LocalHost::os_name
const std::string & os_name() const
name of the operating system
Definition
Host.cpp:298
OksSystem::LocalHost::instance
static const LocalHost * instance()
pointer to the singleton local host
Definition
Host.cpp:255
OksSystem::LocalHost::os_version
const std::string & os_version() const
version of the operating system
Definition
Host.cpp:314
OksSystem::LocalHost::local_name
static const std::string & local_name()
localhostname
Definition
Host.cpp:232
OksSystem::LocalHost::m_release
std::string m_release
release of the operating system
Definition
Host.hpp:74
OksSystem::LocalHost::machine
const std::string & machine() const
version of the operating system
Definition
Host.cpp:322
OksSystem::LocalHost::m_description
std::string m_description
machine description (cached)
Definition
Host.hpp:77
OksSystem::LocalHost::LocalHost
LocalHost()
Definition
Host.cpp:268
OksSystem
Definition
Descriptor.hpp:22
OksSystem::getfullhost
const char * getfullhost()
get fully qualified host name
Definition
Host.cpp:351
std
Definition
SchemaUtils.hpp:118
Generated on
for DUNE-DAQ by
1.18.0