From a85da04601b94aaf55a63e613dae2b2d6a66ada6 Mon Sep 17 00:00:00 2001 From: mfranz Date: Mon, 7 May 2007 14:03:44 +0000 Subject: [PATCH] Add method to return the number of attached listeners. Listeners have become a much more important feature than they were two years or something ago, and it's helpful for debugging and exploration to get this important node property shown in property tree dumps or in the property browser (verbose mode). --- simgear/props/props.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simgear/props/props.hxx b/simgear/props/props.hxx index 12d7ba79..41361c98 100644 --- a/simgear/props/props.hxx +++ b/simgear/props/props.hxx @@ -1110,6 +1110,12 @@ public: void removeChangeListener (SGPropertyChangeListener * listener); + /** + * Get the number of listeners. + */ + int nListeners () const { return _listeners ? _listeners->size() : 0; } + + /** * Fire a value change event to all listeners. */ -- 2.39.5