From: mfranz Date: Mon, 7 May 2007 14:03:44 +0000 (+0000) Subject: Add method to return the number of attached listeners. Listeners have become X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a85da04601b94aaf55a63e613dae2b2d6a66ada6;p=simgear.git 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). --- 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. */