Public Member Functions | Protected Member Functions | Protected Attributes

Value::ValueSource Class Reference

Used internally by the Value class as the base class for its shared value objects. More...

Inherits SingleThreadedReferenceCountedObject, and AsyncUpdater.

List of all members.

Public Member Functions

 ValueSource ()
virtual ~ValueSource ()
virtual var getValue () const =0
 Returns the current value of this object.
virtual void setValue (const var &newValue)=0
 Changes the current value.
void sendChangeMessage (bool dispatchSynchronously)
 Delivers a change message to all the listeners that are registered with this value.

Protected Member Functions

void handleAsyncUpdate ()
 Called back to do whatever your class needs to do.
 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ValueSource)

Protected Attributes

SortedSet< Value * > valuesWithListeners

Detailed Description

Used internally by the Value class as the base class for its shared value objects.

The Value class is essentially a reference-counted pointer to a shared instance of a ValueSource object. If you're feeling adventurous, you can create your own custom ValueSource classes to allow Value objects to represent your own custom data items.


Constructor & Destructor Documentation

Value::ValueSource::ValueSource (  )
virtual Value::ValueSource::~ValueSource (  ) [virtual]

Member Function Documentation

virtual var Value::ValueSource::getValue (  ) const [pure virtual]

Returns the current value of this object.

virtual void Value::ValueSource::setValue ( const var newValue ) [pure virtual]

Changes the current value.

This must also trigger a change message if the value actually changes.

void Value::ValueSource::sendChangeMessage ( bool  dispatchSynchronously )

Delivers a change message to all the listeners that are registered with this value.

If dispatchSynchronously is true, the method will call all the listeners before returning; otherwise it'll dispatch a message and make the call later.

void Value::ValueSource::handleAsyncUpdate (  ) [protected, virtual]

Called back to do whatever your class needs to do.

This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.

Implements AsyncUpdater.

Value::ValueSource::JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( ValueSource   ) [protected]

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines