log_store.cpp
Go to the documentation of this file.
1 
28 #include <log_view/log_store.h>
29 
30 namespace log_view {
31 
32 const std::deque<LogEntry>& LogStore::logs() {
33  std::lock_guard<std::mutex> lock(mutex_);
34  for (const auto& entry: new_logs_) {
35  logs_.push_back(entry);
36  }
37  new_logs_.clear();
38  return logs_;
39 }
40 
41 size_t LogStore::size() const {
42  return logs_.size();
43 }
44 
45 void LogStore::addEntry(const rosgraph_msgs::LogConstPtr& msg) {
46  std::lock_guard<std::mutex> lock(mutex_);
47 
48  new_logs_.push_back(LogEntry(*msg));
49 }
50 
51 } // namespace log_view
size_t size() const
Definition: log_store.cpp:41
std::deque< LogEntry > logs_
Definition: log_store.h:49
const std::deque< LogEntry > & logs()
Definition: log_store.cpp:32
std::mutex mutex_
Definition: log_store.h:52
void addEntry(const rosgraph_msgs::LogConstPtr &msg)
Definition: log_store.cpp:45
std::deque< LogEntry > new_logs_
Definition: log_store.h:50


log_view
Author(s): Marc Alban
autogenerated on Thu Mar 4 2021 03:21:52