|
| | DependentBlock (const std::unordered_map< std::string, std::shared_ptr< Block > > &sources, DepUpdateFunc recalculateFunc) |
| | Constructs a dependent block from source blocks and a recomputation callback.
|
| |
| bool | dependsOn (const std::string &blockName) |
| | Checks whether this dependent block uses a given source block name.
|
| |
| void | init () override |
| | Initializes the dependency graph for this block.
|
| |
| void | update () override |
| | Marks the block as dirty.
|
| |
| void | freeze () override |
| | Freezes the block and all contained parameters.
|
| |
| void | unfreeze () override |
| | Unfreezes the block and contained parameters.
|
| |
| void | detach () |
| | Temporarily detaches this block from its dependency graph.
|
| |
| void | reattach () |
| | Reattaches a previously detached dependent block.
|
| |
| | ~DependentBlock () |
| | Destructor.
|
| |
| void | assign (const LhaID &key, std::shared_ptr< Parameter > param) |
| | Overwrites the payload of a local parameter without triggering block-level notification.
|
| |
| void | assign (const LhaID &key, double value) |
| | Assigns a new scalar value to a local parameter.
|
| |
| std::unordered_map< std::string, std::shared_ptr< Block > > | get_source_blocks () const override |
| | Returns the map of source blocks for this dependent block.
|
| |
| void | clear_above () override |
| | Clears upstream block dependencies.
|
| |
| void | clear_below () override |
| | Clears downstream block dependencies.
|
| |
| void | destroy () override |
| | Destroys this dependent block and its downstream block dependencies.
|
| |
| void | mark_dirty () |
| | Marks this block dirty and propagates the dirty state downstream.
|
| |
| void | ensure_up_to_date () override |
| | Ensures this dependent block is up to date.
|
| |
| | Block ()=default |
| | Default constructor.
|
| |
| | Block (std::shared_ptr< Block > other) |
| | Copy-like constructor from another block.
|
| |
| BlockName | get_name () const |
| | Returns the name of the block.
|
| |
| void | store (const LhaID &id, std::shared_ptr< Parameter > param) override |
| | Stores a new parameter under the given LHA id.
|
| |
| void | assign (const LhaID &key, scalar_t value) |
| | Sets the expected value of an existing parameter.
|
| |
| void | store_or_assign (const LhaID &key, std::shared_ptr< Parameter > param) override |
| | Stores a parameter if absent, otherwise assigns into the existing one.
|
| |
| bool | contains (const LhaID &key) const override |
| | Checks whether the block contains a parameter with the given id.
|
| |
| std::shared_ptr< Parameter > | retrieve (const LhaID &id) override |
| | Retrieves a stored parameter by id.
|
| |
| void | remove (const LhaID &key) override |
| | Removes a parameter and clears its downstream dependency subtree.
|
| |
| std::unordered_set< LhaID > | getAllIDs () |
| | Returns the set of all parameter ids stored in the block.
|
| |
| const std::map< LhaID, std::shared_ptr< Parameter > > & | getItems () |
| | Returns the internal parameter map.
|
| |
| void | set_owner (ParameterType type) |
| | Sets the owner ParameterType on all contained parameters.
|
| |
| void | addObserver (std::shared_ptr< Block > observer) |
| | Adds a block observer if not already present.
|
| |
| void | removeObserver (std::shared_ptr< Block > observer) |
| | Removes a previously registered observer block.
|
| |
| void | notifyObservers () |
| | Notifies all observer blocks that this block has changed.
|
| |
| std::vector< std::shared_ptr< Block > > | getObservers () const |
| | Returns the current list of observer blocks.
|
| |
| void | copy (std::shared_ptr< Block > other) |
| | Copies the content and metadata from another block.
|
| |
| std::shared_ptr< Block > | deep_clone_plain () const |
| | Deep-copies this block as a plain independent block.
|
| |
| bool | has_scale () |
| | Returns whether the block has an associated scale.
|
| |
| void | set_scale (double scale) |
| | Sets the block-wide scale.
|
| |
| double | get_scale () |
| | Returns the block-wide scale.
|
| |
| void | erase_local (const LhaID &id) |
| | Erases an entry from the local storage map only.
|
| |
| void | bind_self (std::shared_ptr< Block > self) |
| | Binds an explicit self shared_ptr to the block.
|
| |
| | ~Block () |
| | Destructor.
|
| |
| virtual | ~IStorage ()=default |
| |
Block whose content is derived from one or more source blocks.
A DependentBlock is a lazily recomputed block:
The actual recomputation logic is provided by a user callback of type DepUpdateFunc.
Additional features:
- freeze/unfreeze support with deferred update,
- detach/reattach support to temporarily disable the dependency graph,
- recursive dirty propagation to downstream dependent blocks and parameters.
- See also
- Block
-
DepUpdateFunc
-
BlockSrc
Definition at line 481 of file Block.h.