Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Static Private Member Functions | Private Attributes

BlitterFactoryBase Class Reference

The base factory, keeping track of all blitters. More...

#include <factory.hpp>

Inheritance diagram for BlitterFactoryBase:
BlitterFactory< T > BlitterFactory< FBlitter_32bppAnim > BlitterFactory< FBlitter_32bppOptimized > BlitterFactory< FBlitter_32bppSimple > BlitterFactory< FBlitter_8bppDebug > BlitterFactory< FBlitter_8bppOptimized > BlitterFactory< FBlitter_8bppSimple > BlitterFactory< FBlitter_Null >

Public Member Functions

virtual const char * GetDescription ()=0
 Get a nice description of the blitter-class.
virtual BlitterCreateInstance ()=0
 Create an instance of this Blitter-class.

Static Public Member Functions

static BlitterSelectBlitter (const char *name)
 Find the requested blitter and return his class.
static BlitterGetCurrentBlitter ()
 Get the current active blitter (always set by calling SelectBlitter).
static char * GetBlittersInfo (char *p, const char *last)
 Fill a buffer with information about the blitters.

Protected Member Functions

void RegisterBlitter (const char *name)
 Register a blitter internally, based on his name.

Private Types

typedef std::map< const char
*, BlitterFactoryBase
*, StringCompare
Blitters
 Map of blitter factories.

Static Private Member Functions

static BlittersGetBlitters ()
 Get the map with currently known blitters.
static Blitter ** GetActiveBlitter ()
 Get the currently active blitter.

Private Attributes

const char * name
 The name of the blitter factory.

Detailed Description

The base factory, keeping track of all blitters.

Definition at line 28 of file factory.hpp.


Member Function Documentation

static Blitter** BlitterFactoryBase::GetActiveBlitter (  )  [inline, static, private]

Get the currently active blitter.

Returns:
The currently active blitter.

Definition at line 48 of file factory.hpp.

Referenced by GetCurrentBlitter(), and SelectBlitter().

static Blitters& BlitterFactoryBase::GetBlitters (  )  [inline, static, private]

Get the map with currently known blitters.

Returns:
The known blitters.

Definition at line 38 of file factory.hpp.

Referenced by GetBlittersInfo(), RegisterBlitter(), and SelectBlitter().

static char* BlitterFactoryBase::GetBlittersInfo ( char *  p,
const char *  last 
) [inline, static]

Fill a buffer with information about the blitters.

Parameters:
p The buffer to fill.
last The last element of the buffer.
Returns:
p The location till where we filled the buffer.

Definition at line 138 of file factory.hpp.

References GetBlitters(), GetDescription(), name, and seprintf().

Referenced by ShowHelp().

void BlitterFactoryBase::RegisterBlitter ( const char *  name  )  [inline, protected]

Register a blitter internally, based on his name.

Parameters:
name the name of the blitter.
Note:
an assert() will be trigger if 2 blitters with the same name try to register.

Definition at line 60 of file factory.hpp.

References GetBlitters().

static Blitter* BlitterFactoryBase::SelectBlitter ( const char *  name  )  [inline, static]

Find the requested blitter and return his class.

Parameters:
name the blitter to select.
Postcondition:
Sets the blitter so GetCurrentBlitter() returns it too.

Definition at line 89 of file factory.hpp.

References CreateInstance(), DEBUG, GetActiveBlitter(), GetBlitters(), name, and StrEmpty().

Referenced by VideoDriver_Null::Start().


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