Skip to main content

FilterStack Struct

Independently-owned state backing the filter stack. More...

Declaration

struct moveit_pro::behavior::LoggerBase::FilterStack { ... }

Public Member Functions Index

voidremove (std::uint64_t id)

Remove the filter with the given id. No-op if it is not present. Thread-safe. More...

Public Member Attributes Index

std::mutexmutex

Guards entries and next_id. More...

std::vector< FilterEntry >entries
std::uint64_tnext_id = 0

Monotonic counter handing out unique ids for FilterEntry. More...

Description

Independently-owned state backing the filter stack.

The logger holds this by shared_ptr; each FilterToken references it by weak_ptr. A token that outlives its logger therefore removes nothing instead of dereferencing a destroyed logger — no use-after-free. Only the top entry is consulted per message; entries are removed by id, so out-of-order token destruction is handled correctly even though nested decorators normally pop in LIFO order. Empty in the common case, in which logging behaves identically to before this mechanism existed.

Definition at line 147 of file logger.hpp.

Public Member Functions

remove()

void moveit_pro::behavior::LoggerBase::FilterStack::remove (std::uint64_t id)

Remove the filter with the given id. No-op if it is not present. Thread-safe.

Declaration at line 156 of file logger.hpp, definition at line 126 of file logger.cpp.

Public Member Attributes

entries

std::vector<FilterEntry> moveit_pro::behavior::LoggerBase::FilterStack::entries

Definition at line 151 of file logger.hpp.

mutex

std::mutex moveit_pro::behavior::LoggerBase::FilterStack::mutex

Guards entries and next_id.

Definition at line 150 of file logger.hpp.

next_id

std::uint64_t moveit_pro::behavior::LoggerBase::FilterStack::next_id = 0

Monotonic counter handing out unique ids for FilterEntry.

Definition at line 153 of file logger.hpp.


The documentation for this struct was generated from the following files:


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.