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
ITransport.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 <cstddef>
9
#include <cstdint>
10
#include <vector>
11
12
#if !defined(_WIN32)
13
// we assume something Linux'ish here
14
# include <sys/types.h>
// for ssize_t
15
#endif
16
17
namespace
visionary
{
18
19
class
ITransport
20
{
21
public
:
22
using
ByteBuffer
= std::vector<std::uint8_t>;
23
24
#if defined(_WIN32)
25
using
send_return_t
= int;
26
using
recv_return_t
= int;
27
#else
28
using
send_return_t
= ssize_t;
29
using
recv_return_t
= ssize_t;
30
#endif
31
32
virtual
~ITransport
() =
default
;
// destructor, use it to call destructor of the inherit classes
33
34
virtual
int
shutdown
() = 0;
35
virtual
int
getLastError
() = 0;
36
44
template
<
typename
T>
45
send_return_t
send
(
const
std::vector<T>& buffer)
46
{
47
return
send
(
reinterpret_cast<
const
char
*
>
(buffer.data()), buffer.size() *
sizeof
(
T
));
48
}
49
58
virtual
recv_return_t
recv
(
ByteBuffer
& buffer, std::size_t maxBytesToReceive) = 0;
59
68
virtual
recv_return_t
read
(
ByteBuffer
& buffer, std::size_t nBytesToReceive) = 0;
69
70
protected
:
71
virtual
send_return_t
send
(
const
char
* pData,
size_t
size) = 0;
72
};
73
74
}
// namespace visionary
visionary::ITransport::read
virtual recv_return_t read(ByteBuffer &buffer, std::size_t nBytesToReceive)=0
T
T
Definition:
mem_fn_cc.hpp:25
visionary::ITransport::recv_return_t
ssize_t recv_return_t
Definition:
ITransport.h:29
visionary
Definition:
MD5.cpp:44
visionary::ITransport::ByteBuffer
std::vector< std::uint8_t > ByteBuffer
Definition:
ITransport.h:22
visionary::ITransport::~ITransport
virtual ~ITransport()=default
visionary::ITransport::send_return_t
ssize_t send_return_t
Definition:
ITransport.h:28
visionary::ITransport::shutdown
virtual int shutdown()=0
visionary::ITransport::send
send_return_t send(const std::vector< T > &buffer)
Definition:
ITransport.h:45
visionary::ITransport::recv
virtual recv_return_t recv(ByteBuffer &buffer, std::size_t maxBytesToReceive)=0
visionary::ITransport
Definition:
ITransport.h:19
visionary::ITransport::getLastError
virtual int getLastError()=0
sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:40:43