Feature Requests item #1602443, was opened at 2006-11-24 20:06
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=725712&aid=1602443&group_id=132964
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: implement listeners for properties
Initial Comment:
it would be useful if there was a way to register listener functions that are automatically called (callback-based) when a certain property is changed, this could for example be used in order to implement validation functionality and similar stuff.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-10-13 05:01
Message:
this is actually a commonly available facility for property tree
implementations in other programming languages, java:
http://java.sun.com/j2se/1.4.2/docs/api/java/beans/PropertyChangeListener.html
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-03-04 16:48
Message:
Logged In: NO
if anybody is interested in such a facility, note that the SimGear
project, one of the dependencies of the open source flight simulator
FlightGear features a property tree implementation including support for
registrable "listeners" that are 'fired' once a property is accessed (i.e.
read from or written to). While FlightGear and SimGear are mostly GNU GPL,
the property stuff is mostly in the public domain, as explicitly stated in
the headers.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-01-16 18:02
Message:
Logged In: NO
listerners would need to be stored in some sort of queue to cater for
cases where multiple listeners may be registered for a single property
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-12-28 15:45
Message:
Logged In: NO
is this actually available meanwhile or at least considered for later
addition?
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-01-22 18:27
Message:
Logged In: NO
the last comment actually contains a pretty useful idea, any plans to
implement this?
or is there anything to take into consideration, if we want to implement
this by ourselves?
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2006-12-08 02:30
Message:
Logged In: NO
with regard to properties and listeners, I would personally also find
another feature useful which basically serves a similar purpose
(synchronization):the possibility to tie (or bind) variables directly to
properties directly in code, for example using a corresponding template
container:
TiedPropertyVariable<int> port=
props.getIntNode("application.daemon.port");
port=1200; // overloaded, so that it would automatically update such tied
properties
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2006-12-05 21:14
Message:
Logged In: NO
well, as a workaround you could simply add a
std::vector<LISTENER_CALLBACKTYPE> for each property path, where
LISTENER_CALLBACKTYPE could be a typedef along the lines of
typedef void (*CALLBACKTYPE) (PARAMS);
(where PARAMS should possibly include a struct that contains the old and
current value of the corresponding property)
That way, you could easily register (and remove) multiple listeners for
individual properties. On the other hand, in the long run it might also be
useful to be able to temporarily disable certain callbacks, i.e. by using
an additional bool ENABLED flag (std::map<bool,LISTENER_CALLBACKTYPE>).
----------------------------------------------------------------------
Comment By: Guenter Obiltschnig (obiltschnig)
Date: 2006-12-04 16:41
Message:
Logged In: YES
user_id=1148207
Originator: NO
This is best done using Poco::AbstractEvent<> and friends. Maybe we can
squeeze it into the 1.3 release.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2006-11-30 16:14
Message:
Logged In: NO
no-while support for functors may be nice to have eventually, I would
personally mainly require support to have simple function callbacks
automatically triggered when a property is being written to
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2006-11-24 20:11
Message:
Logged In: NO
"functors" would probably be a better idea?
also, an implementation would preferably enable programmers to assign
multiple listeners to individual properties, as well as prioritize these
listeners individually
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=725712&aid=1602443&group_id=132964
|