Porytiles
Loading...
Searching...
No Matches
porytiles::LayoutMetadataProvider Class Referenceabstract

Abstract interface for querying layout metadata by name. More...

#include <layout_metadata_provider.hpp>

Inheritance diagram for porytiles::LayoutMetadataProvider:
[legend]

Public Member Functions

virtual ~LayoutMetadataProvider ()=default
 
virtual bool exists (const std::string &layout_name_or_id) const =0
 Checks whether a layout exists in the backing store for the given layout name or ID.
 
virtual ChainableResult< std::size_t > width (const std::string &layout_name_or_id) const =0
 Determines the given layout's width in metatiles.
 
virtual ChainableResult< std::size_t > height (const std::string &layout_name_or_id) const =0
 Determines the given layout's height in metatiles.
 
virtual ChainableResult< std::string > primary_tileset (const std::string &layout_name_or_id) const =0
 Determines the given layout's primary tileset.
 
virtual ChainableResult< std::string > secondary_tileset (const std::string &layout_name_or_id) const =0
 Determines the given layout's secondary tileset.
 
virtual ChainableResult< std::set< std::string > > layout_names () const =0
 Returns all layout names known to this provider.
 
virtual ChainableResult< std::set< std::string > > layout_ids () const =0
 Returns all layout IDs known to this provider.
 

Detailed Description

Abstract interface for querying layout metadata by name.

LayoutMetadataProvider defines a domain-layer abstraction for retrieving metadata about layouts. This allows the domain logic to query layout properties (such as height or width) without depending on any specific data source or I/O mechanism. Concrete implementations may source this metadata from project files, configuration, or other external systems.

Invariant
Implementations must return consistent results for the same layout_name_or_id within a single compilation run.

Definition at line 22 of file layout_metadata_provider.hpp.

Constructor & Destructor Documentation

◆ ~LayoutMetadataProvider()

virtual porytiles::LayoutMetadataProvider::~LayoutMetadataProvider ( )
virtualdefault

Member Function Documentation

◆ exists()

virtual bool porytiles::LayoutMetadataProvider::exists ( const std::string &  layout_name_or_id) const
pure virtual

Checks whether a layout exists in the backing store for the given layout name or ID.

Parameters
layout_name_or_idThe name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY")
Returns
True if the layout exists in the backing store, false otherwise

Implemented in porytiles::ProjectLayoutMetadataProvider.

◆ height()

virtual ChainableResult< std::size_t > porytiles::LayoutMetadataProvider::height ( const std::string &  layout_name_or_id) const
pure virtual

Determines the given layout's height in metatiles.

Parameters
layout_name_or_idThe name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY")
Returns
ChainableResult containing height of the layout

Implemented in porytiles::ProjectLayoutMetadataProvider.

◆ layout_ids()

virtual ChainableResult< std::set< std::string > > porytiles::LayoutMetadataProvider::layout_ids ( ) const
pure virtual

Returns all layout IDs known to this provider.

Enumerates all layout IDs available in the backing store. This enables batch operations, validation, and listing without requiring callers to know layout IDs in advance.

Returns
ChainableResult containing a set of all layout IDs

Implemented in porytiles::ProjectLayoutMetadataProvider.

◆ layout_names()

virtual ChainableResult< std::set< std::string > > porytiles::LayoutMetadataProvider::layout_names ( ) const
pure virtual

Returns all layout names known to this provider.

Enumerates all layout names available in the backing store. This enables batch operations, validation, and listing without requiring callers to know layout names in advance.

Returns
ChainableResult containing a set of all layout names

Implemented in porytiles::ProjectLayoutMetadataProvider.

◆ primary_tileset()

virtual ChainableResult< std::string > porytiles::LayoutMetadataProvider::primary_tileset ( const std::string &  layout_name_or_id) const
pure virtual

Determines the given layout's primary tileset.

Parameters
layout_name_or_idThe name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY")
Returns
ChainableResult containing primary tileset of the layout

Implemented in porytiles::ProjectLayoutMetadataProvider.

◆ secondary_tileset()

virtual ChainableResult< std::string > porytiles::LayoutMetadataProvider::secondary_tileset ( const std::string &  layout_name_or_id) const
pure virtual

Determines the given layout's secondary tileset.

Parameters
layout_name_or_idThe name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY")
Returns
ChainableResult containing secondary tileset of the layout

Implemented in porytiles::ProjectLayoutMetadataProvider.

◆ width()

virtual ChainableResult< std::size_t > porytiles::LayoutMetadataProvider::width ( const std::string &  layout_name_or_id) const
pure virtual

Determines the given layout's width in metatiles.

Parameters
layout_name_or_idThe name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY")
Returns
ChainableResult containing width of the layout

Implemented in porytiles::ProjectLayoutMetadataProvider.


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