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
#include <
yarp/os/PortWriterBuffer.h
>
13
14
#include <mutex>
15
#include <string>
16
#include <
yarp/os/PeriodicThread.h
>
17
18
#include <
yarp/os/BufferedPort.h
>
19
#include <list>
20
21
namespace
yarp::os::impl
{
22
23
class
ThreadedPort
:
public
yarp::os::PeriodicThread
24
{
25
std::mutex mut;
26
yarp::os::BufferedPort<yarp::os::Bottle>
* m_port =
nullptr
;
27
std::list<yarp::os::Bottle> messages;
28
29
void
process();
30
31
public
:
32
void
run
()
override
;
33
void
attach
(
yarp::os::BufferedPort<yarp::os::Bottle>
* port);
34
void
insert
(
const
yarp::os::Bottle
& bot);
35
void
terminate
();
36
public
:
37
ThreadedPort
();
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
PortWriterBuffer.h
Port.h
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition
Bottle.h:65
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:24
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:50
yarp::os::impl::ThreadedPort::insert
void insert(const yarp::os::Bottle &bot)
Definition
LogForwarder.cpp:61
yarp::os::impl::ThreadedPort::ThreadedPort
ThreadedPort()
Definition
LogForwarder.cpp:22
yarp::os::impl::ThreadedPort::terminate
void terminate()
Definition
LogForwarder.cpp:55
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.0+20250913.2+gita97e3bf40
src
libYARP_os
src
yarp
os
impl
LogForwarder.h
Generated on Wed Sep 17 2025 02:41:36 for YARP by
1.9.8