ChessPlusPlus  WIP
cplusplus.com Community Project
chesspp::res::SfmlFileResource< sfmlT > Class Template Reference

Wrap an SFML class for use with the ResourceManager as a file resource. More...

#include <SfmlFileResource.hpp>

Inheritance diagram for chesspp::res::SfmlFileResource< sfmlT >:
chesspp::res::ResourceManager::Resource

Public Member Functions

 SfmlFileResource (std::string const &file_path) noexcept
 Construct the wrapper from a file. More...
 
 operator sfmlT & () noexcept
 Implicitly cast the wrapper to the wrapped resource instance. More...
 
 operator sfmlT const & () const noexcept
 Implicitly cast the wrapper to the wrapped resource instance. More...
 
- Public Member Functions inherited from chesspp::res::ResourceManager::Resource
virtual ~Resource ()=0
 

Public Attributes

sfmlT res
 The wrapped SFML class instance. More...
 

Detailed Description

template<typename sfmlT>
class chesspp::res::SfmlFileResource< sfmlT >

Wrap an SFML class for use with the ResourceManager as a file resource.

Any SFML class which supports .loadFromFile() can be used, such as sf::Sprite and sf::Font.

Template Parameters
TheSFML class to wrap.

Constructor & Destructor Documentation

template<typename sfmlT >
chesspp::res::SfmlFileResource< sfmlT >::SfmlFileResource ( std::string const &  file_path)
inlinenoexcept

Construct the wrapper from a file.

Note
This constructor does not throw, instead it logs an error report to std::cerr
Parameters
file_pathThe file path.

Member Function Documentation

template<typename sfmlT >
chesspp::res::SfmlFileResource< sfmlT >::operator sfmlT & ( )
inlinenoexcept

Implicitly cast the wrapper to the wrapped resource instance.

template<typename sfmlT >
chesspp::res::SfmlFileResource< sfmlT >::operator sfmlT const & ( ) const
inlinenoexcept

Implicitly cast the wrapper to the wrapped resource instance.

Member Data Documentation

template<typename sfmlT >
sfmlT chesspp::res::SfmlFileResource< sfmlT >::res

The wrapped SFML class instance.


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