HoverRace  2.0
Public Member Functions | List of all members
HoverRace::Display::BaseRes Class Referenceabstract

#include <Res.h>

+ Inheritance diagram for HoverRace::Display::BaseRes:

Public Member Functions

virtual ~BaseRes ()
 
virtual std::string GetId () const =0
 Retrieve the ID for this resource. More...
 
virtual std::unique_ptr< std::istream > Open () const =0
 Open the stream for reading. More...
 

Constructor & Destructor Documentation

virtual HoverRace::Display::BaseRes::~BaseRes ( )
inlinevirtual

Member Function Documentation

virtual std::string HoverRace::Display::BaseRes::GetId ( ) const
pure virtual

Retrieve the ID for this resource.

The ID should be unique for every resource being pointed at, so two instances that point to the same resource (e.g. a file) should return the same ID.

This allows loaded resources to be cached, so if two instances point to, say, the same file, then the resource will be loaded once (although this is left as an exercise for the Display).

Returns
The identifier.

Implemented in HoverRace::Display::MediaRes< T >, HoverRace::Display::SpriteTextureRes, and HoverRace::Display::AvatarTextureRes.

virtual std::unique_ptr<std::istream> HoverRace::Display::BaseRes::Open ( ) const
pure virtual

Open the stream for reading.

Returns
The input stream.
Exceptions
ResourceLoadExn

Implemented in HoverRace::Display::MediaRes< T >, HoverRace::Display::SpriteTextureRes, and HoverRace::Display::AvatarTextureRes.


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