Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorLayout::ILayoutSourceFactory Class Referenceabstract

Abstract factory for an ILayoutSource implementation. More...

#include <phosphor-layout-api/include/PhosphorLayoutApi/ILayoutSourceFactory.h>

Inheritance diagram for PhosphorLayout::ILayoutSourceFactory:
[legend]

Public Member Functions

virtual ~ILayoutSourceFactory ()
 
virtual QString name () const =0
 Stable identifier for diagnostics / logging.
 
virtual std::unique_ptr< ILayoutSourcecreate ()=0
 Build a fresh source instance. Caller takes ownership.
 

Detailed Description

Abstract factory for an ILayoutSource implementation.

Each provider library (phosphor-zones, phosphor-tiles, future phosphor-scrolling, third-party plugins) ships a concrete factory alongside its ILayoutSource implementation. The factory carries whatever provider-specific construction arguments the source requires (e.g. a borrowed registry pointer). Calling create hands the caller a fresh source instance bound to those arguments.

LayoutSourceBundle holds a list of factories and assembles a composite of every produced source. Composition roots register factories — adding a new layout-source family (the upcoming scrolling engine) is then one addFactory() line at each root, with no edits to phosphor-layout-api or to the bundle.

Factory contract: the same create() call must be safe to invoke repeatedly and from any thread the caller chooses; concrete factories are responsible for any thread-safety in their stored arguments. Returned sources are heap-owned by the caller (typically via std::unique_ptr).

Constructor & Destructor Documentation

◆ ~ILayoutSourceFactory()

virtual PhosphorLayout::ILayoutSourceFactory::~ILayoutSourceFactory ( )
virtual

Member Function Documentation

◆ create()

virtual std::unique_ptr< ILayoutSource > PhosphorLayout::ILayoutSourceFactory::create ( )
pure virtual

Build a fresh source instance. Caller takes ownership.

Implemented in PhosphorTiles::AutotileLayoutSourceFactory, and PhosphorZones::ZonesLayoutSourceFactory.

◆ name()

virtual QString PhosphorLayout::ILayoutSourceFactory::name ( ) const
pure virtual

Stable identifier for diagnostics / logging.

Should match the provider library name (e.g. "zones", "autotile", "scrolling").

Implemented in PhosphorTiles::AutotileLayoutSourceFactory, and PhosphorZones::ZonesLayoutSourceFactory.


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