Sly Engine
ImageManager Class Reference

#include <ImageManager.h>

Collaboration diagram for ImageManager:
Collaboration graph

Static Public Member Functions

static Image * Get (std::string key)
 Gets an image* using the given key. More...
 
static void Load (const MapKey &key, Texture *tex)
 
static void Load (const MapKey &key, Texture *tex, Rect *r)
 

Private Types

typedef std::string MapKey
 Defines an alias representing the map key. More...
 
typedef std::map< MapKey, Image * > StorageMap
 Defines an alias representing the storage map. More...
 

Private Member Functions

 ImageManager ()
 Default constructor. More...
 
 ImageManager (const ImageManager &)=delete
 Copy constructor. More...
 
 ImageManager (ImageManager &&)=delete
 Move constructor. More...
 
ImageManager & operator= (const ImageManager &)=delete
 Assignment operator. More...
 
ImageManager & operator= (ImageManager &&)=delete
 Move assignment operator. More...
 
 ~ImageManager ()=default
 Deconstructor. More...
 
void privDelete ()
 Deletes this pointer instance. To only be called internally.
More...
 
Image * privGet (std::string key)
 Private get. More...
 
void privLoad (const MapKey &key, Texture *tex)
 Priv load. More...
 
void privLoad (const MapKey &key, Texture *tex, Rect *r4)
 Priv load. More...
 

Static Private Member Functions

static ImageManager & Instance ()
 Gets the ImageManager instance. More...
 
static void Delete ()
 Deletes this pointer instance. To only be called by the engine. More...
 

Private Attributes

std::string defaultPath
 The default path where images are stored. More...
 
StorageMap imageMap
 A map containing images specified by a string key. More...
 

Static Private Attributes

static ImageManager * ptrInstance = nullptr
 Pointer instance to ImageManager. More...
 

Friends

class ImageManagerAttorney
 Dictates access to ImageManager's private functions for engine usage. More...
 

Member Typedef Documentation

◆ MapKey

std::string ImageManager::MapKey
private

Defines an alias representing the map key.

◆ StorageMap

std::map< MapKey, Image * > ImageManager::StorageMap
private

Defines an alias representing the storage map.

Constructor & Destructor Documentation

◆ ImageManager() [1/3]

ImageManager::ImageManager ( )
private

Default constructor.

Here is the caller graph for this function:

◆ ImageManager() [2/3]

ImageManager::ImageManager ( const ImageManager &  )
privatedelete

Copy constructor.

◆ ImageManager() [3/3]

ImageManager::ImageManager ( ImageManager &&  )
privatedelete

Move constructor.

◆ ~ImageManager()

ImageManager::~ImageManager ( )
privatedefault

Deconstructor.

Member Function Documentation

◆ Delete()

static void ImageManager::Delete ( )
inlinestaticprivate

Deletes this pointer instance. To only be called by the engine.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get()

static Image * ImageManager::Get ( std::string  key)
inlinestatic

Gets an image* using the given key.

Parameters
keyThe key to get.
Returns
Assertion if it fails, else a pointer to an Image.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Instance()

static ImageManager & ImageManager::Instance ( )
inlinestaticprivate

Gets the ImageManager instance.

Returns
A reference to ImageManager.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Load() [1/2]

static void ImageManager::Load ( const MapKey &  key,
Texture *  tex 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Load() [2/2]

static void ImageManager::Load ( const MapKey &  key,
Texture *  tex,
Rect *  r 
)
inlinestatic
Here is the call graph for this function:

◆ operator=() [1/2]

ImageManager& ImageManager::operator= ( const ImageManager &  )
privatedelete

Assignment operator.

◆ operator=() [2/2]

ImageManager& ImageManager::operator= ( ImageManager &&  )
privatedelete

Move assignment operator.

◆ privDelete()

void ImageManager::privDelete ( )
private

Deletes this pointer instance. To only be called internally.

Here is the caller graph for this function:

◆ privGet()

Image * ImageManager::privGet ( std::string  key)
private

Private get.

Parameters
keyThe key.
Returns
Assertion if it fails, else a pointer to an Image.
Here is the caller graph for this function:

◆ privLoad() [1/2]

void ImageManager::privLoad ( const MapKey &  key,
Texture *  tex 
)
private

Priv load.

Parameters
keyThe key.
[in,out]texIf non-null, the tex.
Here is the caller graph for this function:

◆ privLoad() [2/2]

void ImageManager::privLoad ( const MapKey &  key,
Texture *  tex,
Rect *  r4 
)
private

Priv load.

Parameters
keyThe key.
[in,out]texIf non-null, the tex.
[in,out]r4If non-null, the fourth Rect.

Friends And Related Function Documentation

◆ ImageManagerAttorney

friend class ImageManagerAttorney
friend

Dictates access to ImageManager's private functions for engine usage.

Member Data Documentation

◆ defaultPath

std::string ImageManager::defaultPath
private

The default path where images are stored.

◆ imageMap

StorageMap ImageManager::imageMap
private

A map containing images specified by a string key.

◆ ptrInstance

ImageManager * ImageManager::ptrInstance = nullptr
staticprivate

Pointer instance to ImageManager.


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