File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,12 +61,26 @@ class DiagsPtr
6161{
6262public:
6363 friend Diags *diags ();
64- static void set (Diags *new_ptr);
64+
65+ // / @brief Registers a Diags instance as the global singleton.
66+ // /
67+ // / @param new_ptr The Diags instance to register. Must not be nullptr.
68+ // / @pre Called during single-threaded process initialization only.
69+ // / @post diags() returns new_ptr. The instance is also registered with the
70+ // / DebugInterface subsystem.
71+ // / @note Not thread-safe. Must be called exactly once before any logging occurs.
72+ static void set (Diags *new_ptr);
6573
6674private:
6775 static Diags *_diags_ptr;
6876};
6977
78+ // / @brief Returns the global Diags singleton.
79+ // /
80+ // / @pre DiagsPtr::set() must have been called with a valid Diags instance.
81+ // / @return Pointer to the global Diags instance, or nullptr if not yet initialized.
82+ // / @note Thread-safe for reading; the pointer is set once during single-threaded
83+ // / initialization and never changes thereafter.
7084inline Diags *
7185diags ()
7286{
You can’t perform that action at this time.
0 commit comments