Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Value::ValueSource Class Referenceabstract

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

#include <juce_Value.h>

Inheritance diagram for Value::ValueSource:

Public Member Functions

 ValueSource ()
 
 ~ValueSource () override
 
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.
 
- Public Member Functions inherited from ReferenceCountedObject
void incReferenceCount () noexcept
 Increments the object's reference count.
 
void decReferenceCount () noexcept
 Decreases the object's reference count.
 
bool decReferenceCountWithoutDeleting () noexcept
 Decreases the object's reference count.
 
int getReferenceCount () const noexcept
 Returns the object's current reference count.
 

Protected Attributes

SortedSet< Value * > valuesWithListeners
 

Additional Inherited Members

- Protected Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject ()=default
 Creates the reference-counted object (with an initial ref count of zero).
 
 ReferenceCountedObject (const ReferenceCountedObject &) noexcept
 Copying from another object does not affect this one's reference-count.
 
 ReferenceCountedObject (ReferenceCountedObject &&) noexcept
 Copying from another object does not affect this one's reference-count.
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &) noexcept
 Copying from another object does not affect this one's reference-count.
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&) noexcept
 Copying from another object does not affect this one's reference-count.
 
virtual ~ReferenceCountedObject ()
 Destructor.
 
void resetReferenceCount () noexcept
 Resets the reference count to zero without deleting the object.
 

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

◆ ValueSource()

Value::ValueSource::ValueSource ( )

◆ ~ValueSource()

Value::ValueSource::~ValueSource ( )
override

Member Function Documentation

◆ getValue()

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

Returns the current value of this object.

◆ setValue()

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.

◆ sendChangeMessage()

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.

Member Data Documentation

◆ valuesWithListeners

SortedSet<Value*> Value::ValueSource::valuesWithListeners
protected

The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram