memory.h
Go to the documentation of this file.
1 #pragma once
2 
3 // SPDX-License-Identifier: BSD-3-Clause
4 // SPDX-FileCopyrightText: Czech Technical University in Prague
5 
12 #include <list>
13 #include <string>
14 
15 #include <ros/console.h>
16 #include <ros/time.h>
17 #include <rosgraph_msgs/Log.h>
18 
20 
21 namespace cras
22 {
23 
28 {
29 public:
30  void initializeImpl() const override;
31 
32  void initializeLogLocationImpl(::ros::console::LogLocation* loc, const ::std::string& name,
33  ::ros::console::Level level) const override;
34 
35  void setLogLocationLevel(::ros::console::LogLocation* loc, ::ros::console::Level level) const override;
36 
37  void checkLogLocationEnabled(::ros::console::LogLocation* loc) const override;
38 
39  void logString(void* logger, ::ros::console::Level level, const std::string& str, const char* file, uint32_t line,
40  const char* function) const override;
41 
46  const ::std::list<::rosgraph_msgs::Log>& getMessages() const;
47 
51  void clear() const;
52 
53 protected:
54  mutable ::std::list<::rosgraph_msgs::Log> messages;
55  mutable ::std::list<::std::string> loggerNames;
56 };
57 
58 }
void clear() const
Delete all messages logged so far.
const ::std::list<::rosgraph_msgs::Log > & getMessages() const
Return all messages logged so far.
mutable ::std::list<::rosgraph_msgs::Log > messages
The list of logged messages.
Definition: memory.h:54
void checkLogLocationEnabled(::ros::console::LogLocation *loc) const override
Check whether the log location is enabled.
Definition: any.hpp:15
void initializeImpl() const override
Initialize the logger. It is not needed to check initialized as this function is only called when it ...
void logString(void *logger, ::ros::console::Level level, const std::string &str, const char *file, uint32_t line, const char *function) const override
This class (reps. its descendants) provides unified access to ROS logging functions, be it ROS_* or NODELET_*.
Definition: log_utils.h:52
ROS logging helpers.
void setLogLocationLevel(::ros::console::LogLocation *loc, ::ros::console::Level level) const override
Set level of a log location. This is only called when global logging level changes.
void initializeLogLocationImpl(::ros::console::LogLocation *loc, const ::std::string &name, ::ros::console::Level level) const override
mutable ::std::list<::std::string > loggerNames
Cache of names of known loggers. Do not ever erase items.
Definition: memory.h:55


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53