Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
state_tree.hpp File Reference
#include <algorithm>
#include <cstdint>
#include <functional>
#include <initializer_list>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <string_view>
#include <variant>
#include <vector>
#include <pulp/runtime/result.hpp>

Go to the source code of this file.

Classes

struct  pulp::state::PropertyArrayValue
struct  pulp::state::PropertyObjectValue
struct  pulp::state::PropertyArray
struct  pulp::state::PropertyObject
struct  pulp::state::TreeEditError
 Error value for a refused StateTree edit. More...
class  pulp::state::StateTree
 Reactive tree node — each node has a type name, properties, and children. More...
class  pulp::state::StateTree::Transaction
 RAII transaction on a StateTree. More...
class  pulp::state::StateTree::ValidatedTransaction
 A transaction whose edits are checked and return TreeEditResult instead of being silently ignored. More...
class  pulp::state::StateTree::SyncedClone
 Owns the listener wiring created by StateTree::clone_synced(). More...
class  pulp::state::ObservableValue< T >
 Observable value — wraps a single value with change notification. More...

Namespaces

namespace  pulp
namespace  pulp::state
 SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the bulk, observable state a step sequencer / mod-matrix / pattern engine holds outside its automatable parameter set (e.g.

Typedefs

using pulp::state::PropertyValue
 Property value — can hold scalar values plus immutable recursive arrays and string-keyed objects.
using pulp::state::TreeListener
 Listener callback — receives the tree node, property name, old value, new value.
using pulp::state::ChildListener = std::function<void(StateTree& parent, StateTree& child, int index)>
 Child listener — receives parent, child, index.
using pulp::state::ChildMovedListener
 Reorder listener — a child moved within the same parent from old_index to new_index (both positions at the time of the edit).
using pulp::state::ParentChangedListener = std::function<void(StateTree& node, StateTree* old_parent)>
 Parent-changed listener — node's parent pointer changed.
using pulp::state::AncestorChangedListener = std::function<void(StateTree& node)>
 Ancestor-changed listener — some ancestor link above node changed (the node itself or one of its ancestors was added, removed or moved).
using pulp::state::TreeEditResult = runtime::Result<std::monostate, TreeEditError>
 Result of a checked StateTree edit: success carries no value.
using pulp::state::PropertyValidator
 Property validator used by checked edits.

Enumerations

enum class  pulp::state::ListenerDelivery { pulp::state::kCoalesced , pulp::state::kImmediate }
 When a listener is told about edits made inside a StateTree::Transaction. More...
enum class  pulp::state::TreeEditErrorCode {
  pulp::state::kInvalidName , pulp::state::kMissingProperty , pulp::state::kNullChild , pulp::state::kIndexOutOfRange ,
  pulp::state::kWouldCreateCycle , pulp::state::kTransactionConflict , pulp::state::kRejectedByValidator , pulp::state::kNotInTransaction ,
  pulp::state::kReentrantTransaction , pulp::state::kTransactionClosed
}
 Why a checked StateTree edit was refused. More...

Functions

bool pulp::state::operator== (const PropertyArrayValue &a, const PropertyArrayValue &b)
bool pulp::state::operator!= (const PropertyArrayValue &a, const PropertyArrayValue &b)
bool pulp::state::operator== (const PropertyObjectValue &a, const PropertyObjectValue &b)
bool pulp::state::operator!= (const PropertyObjectValue &a, const PropertyObjectValue &b)
bool pulp::state::operator== (const PropertyArray &a, const PropertyArray &b)
bool pulp::state::operator!= (const PropertyArray &a, const PropertyArray &b)
bool pulp::state::operator== (const PropertyObject &a, const PropertyObject &b)
bool pulp::state::operator!= (const PropertyObject &a, const PropertyObject &b)
PropertyValue pulp::state::make_property_array (std::vector< PropertyValue > values)
PropertyValue pulp::state::make_property_array (std::initializer_list< PropertyValue > values)
PropertyValue pulp::state::make_property_object (std::map< std::string, PropertyValue, std::less<> > values)
PropertyValue pulp::state::make_property_object (std::initializer_list< PropertyObject::Member > values)
const PropertyArray * pulp::state::get_property_array (const PropertyValue &value)
const PropertyObject * pulp::state::get_property_object (const PropertyValue &value)