SOFA API  7299611c
Open source framework for multi-physics simuation
sofa::helper::logging::OnceTracker Struct Reference

#include <Messaging.h>

Detailed Description

Per-call-site bookkeeping for the msg_*_once macros. Each msg_*_once site owns one thread_local OnceTracker; it records the set of emitter instances (keyed by address) that have already emitted there, so a message is shown once per component instance rather than once for the whole program. Because the tracker is thread_local, no synchronization is needed; the guarantee is "once per instance per thread" (identical to "once per instance" when a given emitter only logs from a single thread).

Public Member Functions

bool firstTimeFor (const void *emitter)
 Returns true the first time it sees a given emitter, false afterwards. More...
 

Function details

◆ firstTimeFor()

bool sofa::helper::logging::OnceTracker::firstTimeFor ( const void *  emitter)
inline

Returns true the first time it sees a given emitter, false afterwards.