mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
4 years ago
|
/**
|
||
5 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
5 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
5 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
5 years ago
|
*
|
||
|
*/
|
||
|
|
||
|
#ifndef SRSLOG_DETAIL_LOG_ENTRY_H
|
||
|
#define SRSLOG_DETAIL_LOG_ENTRY_H
|
||
|
|
||
4 years ago
|
#include "srsran/srslog/detail/log_entry_metadata.h"
|
||
|
#include "srsran/srslog/detail/support/thread_utils.h"
|
||
5 years ago
|
|
||
|
namespace srslog {
|
||
|
|
||
|
class sink;
|
||
|
|
||
|
namespace detail {
|
||
|
|
||
4 years ago
|
/// This command flushes all the messages pending in the backend.
|
||
|
struct flush_backend_cmd {
|
||
|
shared_variable<bool>& completion_flag;
|
||
|
std::vector<sink*> sinks;
|
||
|
};
|
||
|
|
||
5 years ago
|
/// This structure packs all the required data required to create a log entry in
|
||
|
/// the backend.
|
||
4 years ago
|
//:TODO: replace this object using a real command pattern when we have a raw
|
||
|
// memory queue for passing entries.
|
||
5 years ago
|
struct log_entry {
|
||
|
sink* s;
|
||
4 years ago
|
std::function<void(log_entry_metadata&& metadata, fmt::memory_buffer& buffer)>
|
||
|
format_func;
|
||
|
log_entry_metadata metadata;
|
||
4 years ago
|
std::unique_ptr<flush_backend_cmd> flush_cmd;
|
||
5 years ago
|
};
|
||
|
|
||
|
} // namespace detail
|
||
|
|
||
|
} // namespace srslog
|
||
|
|
||
|
#endif // SRSLOG_DETAIL_LOG_ENTRY_H
|