Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
Variables
_
a
b
i
k
n
p
r
s
t
v
Typedefs
a
b
c
f
h
i
m
n
p
s
t
u
w
y
Enumerations
Enumerator
a
b
c
e
f
h
i
l
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
~
Variables
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
Enumerator
a
b
c
e
g
i
k
l
m
n
o
p
r
s
u
v
Related Functions
a
b
c
d
e
i
l
m
o
r
s
u
w
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
g
m
o
p
r
s
t
Variables
_
a
b
f
g
l
t
u
Typedefs
Enumerations
Enumerator
Macros
_
a
b
c
e
f
g
i
l
m
r
s
u
v
w
x
sick_visionary_cpp_shared
src
SockRecord.h
Go to the documentation of this file.
1
//
2
// Copyright (c) 2023 SICK AG, Waldkirch
3
//
4
// SPDX-License-Identifier: Unlicense
5
6
#pragma once
7
8
// Include socket
9
#ifdef _WIN32 // Windows specific
10
# ifdef NOMINMAX
11
# undef NOMINMAX
12
# endif
13
# define NOMINMAX
14
15
# include <winsock2.h>
16
# include <ws2tcpip.h>
17
// to use with other compiler than Visual C++ need to set Linker flag -lws2_32
18
# ifdef _MSC_VER
19
# pragma comment(lib, "ws2_32.lib")
20
# endif
21
#else // Linux specific
22
# include <arpa/inet.h>
23
# include <netinet/in.h>
24
# include <sys/socket.h>
25
# include <sys/types.h>
26
# include <unistd.h>
27
28
typedef
int
SOCKET
;
29
# define INVALID_SOCKET (SOCKET(-1))
30
# define SOCKET_ERROR (-1)
31
#endif
32
33
namespace
visionary
{
34
35
class
SockRecord
36
{
37
public
:
38
SockRecord
() :
m_socket
(
INVALID_SOCKET
)
39
{
40
}
41
42
SockRecord
(
SOCKET
socket
)
43
{
44
m_socket
=
socket
;
45
}
46
47
bool
isValid
()
const
48
{
49
return
m_socket
!=
INVALID_SOCKET
;
50
}
51
SOCKET
socket
()
const
52
{
53
return
m_socket
;
54
}
55
56
void
set
(
SOCKET
socket
)
57
{
58
m_socket
=
socket
;
59
}
60
void
invalidate
()
61
{
62
m_socket
=
INVALID_SOCKET
;
63
}
64
65
private
:
66
SOCKET
m_socket
;
67
68
};
// end class SockRecord
69
70
}
// namespace visionary
visionary
Definition:
MD5.cpp:44
visionary::SockRecord::SockRecord
SockRecord(SOCKET socket)
Definition:
SockRecord.h:42
visionary::SockRecord::socket
SOCKET socket() const
Definition:
SockRecord.h:51
visionary::SockRecord::m_socket
SOCKET m_socket
Definition:
SockRecord.h:66
visionary::SockRecord
Definition:
SockRecord.h:35
INVALID_SOCKET
#define INVALID_SOCKET
Definition:
SockRecord.h:29
SOCKET
int SOCKET
Definition:
SockRecord.h:28
visionary::SockRecord::SockRecord
SockRecord()
Definition:
SockRecord.h:38
visionary::SockRecord::set
void set(SOCKET socket)
Definition:
SockRecord.h:56
visionary::SockRecord::isValid
bool isValid() const
Definition:
SockRecord.h:47
visionary::SockRecord::invalidate
void invalidate()
Definition:
SockRecord.h:60
sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:48:40