Porytiles
Loading...
Searching...
No Matches
porytiles::TilesetRepo Class Referencefinal

Repository interface for the Tileset aggregate root. More...

#include <tileset_repo.hpp>

Public Member Functions

 TilesetRepo (gsl::not_null< const ArtifactChecksumProvider * > checksum_provider, gsl::not_null< const TilesetMetadataProvider * > metadata_provider, gsl::not_null< const TilesetArtifactKeyProvider * > key_provider, gsl::not_null< const TilesetArtifactReader * > reader, gsl::not_null< TilesetArtifactWriter * > writer, gsl::not_null< const UserDiagnostics * > diag)
 Constructs a TilesetRepo with the required dependencies.
 
ChainableResult< void > save (const Tileset &tileset) const
 Persists a given Tileset and caches new artifact checksums.
 
ChainableResult< std::unique_ptr< Tileset > > load (const std::string &name) const
 Loads an existing Tileset from storage.
 
bool exists (const std::string &tileset_name) const
 Checks if the given Tileset exists in the backing store.
 
const ArtifactChecksumProviderchecksum_provider () const
 Gets a reference to the ArtifactChecksumProvider for this repo.
 
const TilesetArtifactKeyProviderkey_provider () const
 Gets a reference to the TilesetArtifactKeyProvider for this repo.
 

Detailed Description

Repository interface for the Tileset aggregate root.

The TilesetRepo makes no assumptions about the structure of the backing store for the Tileset. The implementation details are handled by the supplied reader, writer, and key provider.

Definition at line 26 of file tileset_repo.hpp.

Constructor & Destructor Documentation

◆ TilesetRepo()

porytiles::TilesetRepo::TilesetRepo ( gsl::not_null< const ArtifactChecksumProvider * >  checksum_provider,
gsl::not_null< const TilesetMetadataProvider * >  metadata_provider,
gsl::not_null< const TilesetArtifactKeyProvider * >  key_provider,
gsl::not_null< const TilesetArtifactReader * >  reader,
gsl::not_null< TilesetArtifactWriter * >  writer,
gsl::not_null< const UserDiagnostics * >  diag 
)
inlineexplicit

Constructs a TilesetRepo with the required dependencies.

Initializes the repository with all necessary components for tileset persistence operations. These dependencies provide the concrete implementations for metadata management, key generation, and artifact I/O operations.

Parameters
checksum_providerProvider for computing and caching artifact checksums
metadata_providerProvider for getting tileset metadata
key_providerProvider for generating keys and discovering artifacts in the backing store
readerReader implementation for loading artifacts from the backing store
writerWriter implementation for saving artifacts to the backing store
diagPointer to a UserDiagnostics for this repo

Definition at line 42 of file tileset_repo.hpp.

Member Function Documentation

◆ checksum_provider()

const ArtifactChecksumProvider & porytiles::TilesetRepo::checksum_provider ( ) const
inline

Gets a reference to the ArtifactChecksumProvider for this repo.

Returns
Reference to the provider

Definition at line 87 of file tileset_repo.hpp.

◆ exists()

bool porytiles::TilesetRepo::exists ( const std::string &  tileset_name) const

Checks if the given Tileset exists in the backing store.

Parameters
tileset_nameThe name of the Tileset to check.
Returns
True if the named tileset exists, false otherwise.

Definition at line 483 of file tileset_repo.cpp.

◆ key_provider()

const TilesetArtifactKeyProvider & porytiles::TilesetRepo::key_provider ( ) const
inline

Gets a reference to the TilesetArtifactKeyProvider for this repo.

Returns
Reference to the provider

Definition at line 97 of file tileset_repo.hpp.

◆ load()

ChainableResult< std::unique_ptr< Tileset > > porytiles::TilesetRepo::load ( const std::string &  name) const

Loads an existing Tileset from storage.

Parameters
nameThe name of the Tileset to load.
Returns
A Tileset Result on success, otherwise an error description.

Definition at line 198 of file tileset_repo.cpp.

◆ save()

ChainableResult< void > porytiles::TilesetRepo::save ( const Tileset tileset) const

Persists a given Tileset and caches new artifact checksums.

When persisting a Tileset, the repository saves the tileset and caches new artifact checksums for the persisted data.

Parameters
tilesetThe Tileset to save.
Returns
An empty ChainableResult on success, otherwise an error trace.

Definition at line 17 of file tileset_repo.cpp.


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