MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Nexus::Tapestry Class Reference

Owner of one or more Fabrics and the shared state they rely on. More...

#include <Tapestry.hpp>

+ Collaboration diagram for MayaFlux::Nexus::Tapestry:

Public Member Functions

const std::unordered_map< std::string, std::shared_ptr< Expanse > > & all_expanses () const
 Read-only view of all Expanses owned by this Tapestry.
 
const std::vector< std::shared_ptr< Fabric > > & all_fabrics () const
 All woven Fabrics, named and unnamed.
 
void commit_all ()
 Commit all woven Fabrics in insertion order.
 
template<typename T , typename... Args>
std::shared_ptr< T > create_expanse (std::string name, Args &&... args)
 Create and register a named Expanse of a derived type.
 
std::shared_ptr< Expanse > create_expanse (std::string name, const Kinesis::AABB3D &bounds)
 Create and register a named Expanse that is a box.
 
std::shared_ptr< Expanse > create_expanse (std::string name, Expanse::ContainsFn contains)
 Create and register a named Expanse from a containment predicate alone.
 
std::shared_ptr< Expanse > create_expanse (std::string name, Expanse::ContainsFn contains, Expanse::CrossingFn on_enter, Expanse::CrossingFn on_exit)
 Create and register a named Expanse.
 
std::shared_ptr< Fabric > create_fabric (float cell_size=1.0F)
 create_fabric a new unnamed Fabric into the Tapestry.
 
std::shared_ptr< Fabric > create_fabric (std::string name, float cell_size=1.0F)
 create_fabric a new named Fabric into the Tapestry.
 
std::shared_ptr< Expanse > get_expanse (std::string_view name) const
 Look up a named Expanse.
 
std::shared_ptr< Fabric > get_fabric (std::string_view name) const
 Look up a named Fabric.
 
Tapestry & operator= (const Tapestry &)=delete
 
Tapestry & operator= (Tapestry &&)=delete
 
void remove_expanse (std::string_view name)
 Remove Tapestry's owning reference to a named Expanse.
 
void remove_fabric (const std::shared_ptr< Fabric > &fabric)
 Remove a Fabric by pointer.
 
void remove_fabric (std::string_view name)
 Remove a Fabric by name.
 
 Tapestry (const Tapestry &)=delete
 
 Tapestry (std::shared_ptr< Vruta::TaskScheduler > scheduler, std::shared_ptr< Vruta::EventManager > event_manager)
 Construct with shared scheduler and event manager.
 
 Tapestry (Tapestry &&)=delete
 
 ~Tapestry ()
 

Private Member Functions

std::shared_ptr< Expanse > claim (std::string name, std::shared_ptr< Expanse > expanse)
 

Private Attributes

std::shared_ptr< Vruta::EventManager > m_event_manager
 
std::unordered_map< std::string, std::shared_ptr< Expanse > > m_expanses
 
std::vector< std::shared_ptr< Fabric > > m_fabrics
 
std::unordered_map< std::string, std::weak_ptr< Fabric > > m_named_fabrics
 
uint32_t m_next_id { 1 }
 
std::shared_ptr< Vruta::TaskScheduler > m_scheduler
 

Detailed Description

Owner of one or more Fabrics and the shared state they rely on.

A Tapestry holds shared_ptrs to the TaskScheduler and EventManager each Fabric needs, and serves as the authoring-surface layer above raw Fabric construction. Fabrics woven through a Tapestry can be looked up by name for state encoding, cross-fabric queries, and coordinated commits.

Tapestry holds owning references to the scheduler and event manager so that every Fabric it create_fabrics is guaranteed a valid backing for the Tapestry's lifetime.

Definition at line 25 of file Tapestry.hpp.


The documentation for this class was generated from the following files: