3D Graphics Engine for ESP32
 
Loading...
Searching...
No Matches
Ragot::Assets Class Reference

Manages the asset paths for the application. More...

#include <Assets.hpp>

Collaboration diagram for Ragot::Assets:
Collaboration graph

Public Member Functions

void initialize (const string &executable_file_path)
 Initializes the base path for assets based on the executable file path.
 
path get_asset_path (const string &asset_name)
 Gets the full path of an asset by its name.
 

Static Public Member Functions

static Assetsinstance ()
 Returns the singleton instance of the Assets class.
 

Private Member Functions

 Assets ()=default
 Construct a new Assets object.
 
 Assets (const Assets &)=delete
 Destroy the Assets object.
 
 Assets (const Assets &&)=delete
 Move constructor is deleted to prevent moving the Assets instance.
 
Assetsoperator= (const Assets &)=delete
 Assignment operator is deleted to prevent copying the Assets instance.
 
Assetsoperator= (const Assets &&)=delete
 Move assignment operator is deleted to prevent moving the Assets instance.
 

Private Attributes

path base_path = "./"
 

Detailed Description

Manages the asset paths for the application.

The Assets class provides a singleton instance to manage asset paths, allowing for easy retrieval of asset files. It initializes the base path based on the executable file path, and provides a method to get the full path of an asset by its name.

Constructor & Destructor Documentation

◆ Assets() [1/3]

Ragot::Assets::Assets ( )
privatedefault

Construct a new Assets object.

Here is the caller graph for this function:

◆ Assets() [2/3]

Ragot::Assets::Assets ( const Assets & )
privatedelete

Destroy the Assets object.

Here is the call graph for this function:

◆ Assets() [3/3]

Ragot::Assets::Assets ( const Assets && )
privatedelete

Move constructor is deleted to prevent moving the Assets instance.

Here is the call graph for this function:

Member Function Documentation

◆ get_asset_path()

path Ragot::Assets::get_asset_path ( const string & asset_name)
inline

Gets the full path of an asset by its name.

This method constructs the full path to an asset file by appending the asset name to the base path.

Parameters
asset_nameThe name of the asset file.
Returns
path The full path to the asset file.

◆ initialize()

void Ragot::Assets::initialize ( const string & executable_file_path)
inline

Initializes the base path for assets based on the executable file path.

This method sets the base path to the "assets" directory relative to the executable's location. In debug mode, it uses a relative path to the assets directory. In release mode, it sets the base path to a specific directory.

Parameters
executable_file_pathThe path of the executable file.

◆ instance()

static Assets & Ragot::Assets::instance ( )
inlinestatic

Returns the singleton instance of the Assets class.

This method ensures that only one instance of the Assets class exists throughout the application.

Returns
Assets& Reference to the singleton instance of Assets.
Here is the call graph for this function:

◆ operator=() [1/2]

Assets & Ragot::Assets::operator= ( const Assets && )
privatedelete

Move assignment operator is deleted to prevent moving the Assets instance.

Here is the call graph for this function:

◆ operator=() [2/2]

Assets & Ragot::Assets::operator= ( const Assets & )
privatedelete

Assignment operator is deleted to prevent copying the Assets instance.

Here is the call graph for this function:

Member Data Documentation

◆ base_path

path Ragot::Assets::base_path = "./"
private

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