7 #include "drake/drakeSystemFramework_export.h" 40 DRAKE_ASSERT(std::find(listeners_.begin(), listeners_.end(), listener)
42 listeners_.push_back(listener);
50 auto found = std::find(listeners_.begin(), listeners_.end(), listener);
52 listeners_.erase(found);
57 for (
auto listener : listeners_)
58 listener->Invalidate();
62 std::vector<ValueListenerInterface*> listeners_;
virtual void Invalidate()=0
Mark this dependent computation "not current", and propagate that to downstream dependents of this li...
Definition: constants.h:3
void add_listener(ValueListenerInterface *listener)
Add a new listener to this list.
Definition: value_listener3.h:38
A ValueListenerList object maintains a list of value listeners that have registered to receive notifi...
Definition: value_listener3.h:34
ValueListenerInterface is an interface that dependent computations must implement so that they can re...
Definition: value_listener3.h:19
void NotifyListeners()
Notify all dependents of this value that the value has changed.
Definition: value_listener3.h:56
#define DRAKE_ASSERT(condition)
DRAKE_ASSERT(condition) is similar to the built-in assert(condition) from the C++ system header <cas...
Definition: drake_assert.h:35
Provides Drake's assertion implementation.
#define DRAKE_ABORT_UNLESS(condition)
Evaluates condition and iff the value is false will ::abort() the program with a message showing at l...
Definition: drake_assert.h:39
void RemoveListener(ValueListenerInterface *listener)
Remove a listener from the list.
Definition: value_listener3.h:49
virtual ~ValueListenerInterface()
Definition: value_listener3.h:21