FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption > Class Template Reference

Public Types

using SharedDataType = typename TDataAccessorManagerInfo::Manager::DataBlockPointer
 
using SharedType = typename TDataAccessorManagerInfo::Manager::DataBlockType::DataPointer
 

Public Member Functions

 BaseDataAccessor (std::string_view name)
 Get resource by its name.
 
 BaseDataAccessor (char const name[])
 
 BaseDataAccessor (std::string name)
 
 BaseDataAccessor (SharedDataType data)
 Get resource from a user provided data block.
 
 BaseDataAccessor (SharedType data)
 Get resource from a user provided data pointer.
 
virtual void clear ()
 Clear the resource.
 
void reload ()
 Reload the cached resource from the same name.
 
bool valid () const
 Check if the font is valid (not unloaded)
 
SharedDataType const & getSharedBlock () const
 Get the resource block data.
 
SharedType const & getSharedData () const
 Get the shared resource data.
 
std::string const & getName () const
 Get the name of the resource.
 
auto & operator= (std::string_view name)
 
auto & operator= (char const name[])
 
auto & operator= (std::string name)
 
auto & operator= (SharedDataType data)
 
auto & operator= (SharedType data)
 
TDataAccessorManagerInfo::Manager::DataType * retrieve ()
 Retrieve the raw shared pointer from the current resource.
 
TDataAccessorManagerInfo::Manager::DataType const * retrieve () const
 

Constructor & Destructor Documentation

◆ BaseDataAccessor() [1/3]

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::BaseDataAccessor ( std::string_view name)

Get resource by its name.

Parameters
nameThe name of the loaded resource

◆ BaseDataAccessor() [2/3]

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::BaseDataAccessor ( SharedDataType data)

Get resource from a user provided data block.

Parameters
dataThe user provided data block

◆ BaseDataAccessor() [3/3]

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
requires (TOption == DataAccessorOptions::ALLOW_VARIANT_OF_DATAPOINTER_AND_BLOCKPOINTER)
fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::BaseDataAccessor ( SharedType data)

Get resource from a user provided data pointer.

Parameters
dataThe user provided data pointer

Member Function Documentation

◆ clear()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
void fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::clear ( )
virtual

Clear the resource.

This method clear the resource by setting it to the default/bad "valid" resource.

Reimplemented in fge::Animation.

◆ getName()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
std::string const & fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::getName ( ) const
nodiscard

Get the name of the resource.

Returns
The name of the resource, or an empty string if the resource is not valid

◆ getSharedBlock()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
BaseDataAccessor< TDataAccessorManagerInfo, TOption >::SharedDataType const & fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::getSharedBlock ( ) const
nodiscard

Get the resource block data.

Warning
If ALLOW_VARIANT_OF_DATAPOINTER_AND_BLOCKPOINTER is set, this method can a "bad" element.
Returns
The resource block data

◆ getSharedData()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
requires (TOption == DataAccessorOptions::ALLOW_VARIANT_OF_DATAPOINTER_AND_BLOCKPOINTER)
BaseDataAccessor< TDataAccessorManagerInfo, TOption >::SharedType const & fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::getSharedData ( ) const
nodiscard

Get the shared resource data.

Returns
The shared resource data

◆ reload()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
void fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::reload ( )

Reload the cached resource from the same name.

◆ retrieve()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
TDataAccessorManagerInfo::Manager::DataType * fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::retrieve ( )
nodiscard

Retrieve the raw shared pointer from the current resource.

Warning
Will never be nullptr if the manager was correctly initialized.
Returns
The raw resource pointer

◆ valid()

template<class TDataAccessorManagerInfo , DataAccessorOptions TOption>
bool fge::manager::BaseDataAccessor< TDataAccessorManagerInfo, TOption >::valid ( ) const
nodiscard

Check if the font is valid (not unloaded)

Returns
True if the font is valid, false otherwise

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