YARP
Yet Another Robot Platform
LogForwarder.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_IMPL_LOGFORWARDER_H
10 #define YARP_OS_IMPL_LOGFORWARDER_H
11 
12 #include <yarp/os/api.h>
13 
14 #include <yarp/os/Port.h>
15 
16 #include <mutex>
17 #include <string>
18 
19 namespace yarp {
20 namespace os {
21 namespace impl {
22 
24 {
25 public:
27  static LogForwarder& getInstance();
28 
29  void forward(const std::string& message);
30  static void shutdown();
31 
32 private:
33  LogForwarder();
34  LogForwarder(LogForwarder const&) = delete;
35  LogForwarder& operator=(LogForwarder const&) = delete;
36 
37  std::mutex mutex;
38  yarp::os::Port outputPort;
39  static bool started;
40 };
41 
42 } // namespace impl
43 } // namespace os
44 } // namespace yarp
45 
46 #endif // YARP_OS_IMPL_LOGFORWARDER_H
Port.h
api.h
yarp::os::impl::LogForwarder::~LogForwarder
~LogForwarder()
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::os::impl::LogForwarder
Definition: LogForwarder.h:24
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
YARP_os_impl_API
#define YARP_os_impl_API
Definition: api.h:45