YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
LogForwarder.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#ifndef YARP_OS_IMPL_LOGFORWARDER_H
7
#define YARP_OS_IMPL_LOGFORWARDER_H
8
9
#include <
yarp/os/api.h
>
10
11
#include <
yarp/os/Port.h
>
12
13
#include <mutex>
14
#include <string>
15
#include <
yarp/os/PeriodicThread.h
>
16
17
#include <
yarp/os/BufferedPort.h
>
18
#include <list>
19
20
namespace
yarp::os::impl
{
21
22
class
ThreadedPort
:
public
yarp::os::PeriodicThread
23
{
24
std::mutex mut;
25
yarp::os::BufferedPort<yarp::os::Bottle>
* m_port =
nullptr
;
26
std::list<yarp::os::Bottle> messages;
27
28
void
process();
29
30
public
:
31
void
run
()
override
;
32
void
attach
(
yarp::os::BufferedPort<yarp::os::Bottle>
* port);
33
void
insert
(
const
yarp::os::Bottle
& bot);
34
void
terminate
();
35
public
:
36
ThreadedPort
();
37
~ThreadedPort
()
override
;
38
};
39
40
//----------------------------------------------------------------
41
42
class
YARP_os_impl_API
LogForwarder
43
{
44
public
:
45
~LogForwarder
();
46
static
LogForwarder
& getInstance();
47
48
void
forward(
const
std::string& message);
49
std::string getLogPortName();
50
static
void
shutdown();
51
52
private
:
53
LogForwarder
();
54
LogForwarder
(
LogForwarder
const
&) =
delete
;
55
LogForwarder
& operator=(
LogForwarder
const
&) =
delete
;
56
57
ThreadedPort
tport;
58
yarp::os::BufferedPort<yarp::os::Bottle>
outputPort;
59
static
bool
started;
60
};
61
62
}
// namespace yarp::os::impl
63
64
#endif
// YARP_OS_IMPL_LOGFORWARDER_H
BufferedPort.h
PeriodicThread.h
Port.h
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition
Bottle.h:64
yarp::os::BufferedPort
A mini-server for performing network communication in the background.
Definition
BufferedPort.h:60
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition
PeriodicThread.h:27
yarp::os::impl::LogForwarder
Definition
LogForwarder.h:43
yarp::os::impl::LogForwarder::~LogForwarder
~LogForwarder()
yarp::os::impl::ThreadedPort
Definition
LogForwarder.h:23
yarp::os::impl::ThreadedPort::run
void run() override
Loop function.
yarp::os::impl::ThreadedPort::attach
void attach(yarp::os::BufferedPort< yarp::os::Bottle > *port)
Definition
LogForwarder.cpp:55
yarp::os::impl::ThreadedPort::insert
void insert(const yarp::os::Bottle &bot)
Definition
LogForwarder.cpp:66
yarp::os::impl::ThreadedPort::~ThreadedPort
~ThreadedPort() override
Definition
LogForwarder.cpp:27
yarp::os::impl::ThreadedPort::ThreadedPort
ThreadedPort()
Definition
LogForwarder.cpp:22
yarp::os::impl::ThreadedPort::terminate
void terminate()
Definition
LogForwarder.cpp:60
yarp::os::impl
The components from which ports and connections are built.
api.h
YARP_os_impl_API
#define YARP_os_impl_API
Definition
api.h:46
YARP
4.0.2+169-20261113.4+git2cc772dc6
src
libYARP_os
src
yarp
os
impl
LogForwarder.h
Generated on Sun Nov 15 2026 02:12:10 for YARP by
1.9.8