MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Mezzanine::Threading::ThreadSpecificStorage Class Reference

A thread specific collection of double-buffered and algorithm specific resources. More...

#include <doublebufferedresource.h>

Public Member Functions

 ThreadSpecificStorage (FrameScheduler *Scheduler_)
 A constructor that automatically creates the resources it supports.
 
virtual ~ThreadSpecificStorage ()
 Deletes all the resources.
 
FrameSchedulerGetFrameScheduler ()
 Get a pointer to the FrameScheduler that owns this resource. More...
 
template<typename DBR >
DBR & GetResource (const Whole &ResourceID)
 Get a Specific kind of double buffered resource. More...
 
LoggerGetUsableLogger ()
 Get the usable logger for this thread specific resource. More...
 
void SwapAllBufferedResources ()
 The commitable and usable version of every double buffered resource for this thread specific storage will be swapped.
 

Detailed Description

A thread specific collection of double-buffered and algorithm specific resources.

This class is intended to be expanded via derived classes if it is to return extra resource types

Definition at line 145 of file doublebufferedresource.h.

Member Function Documentation

FrameScheduler* Mezzanine::Threading::ThreadSpecificStorage::GetFrameScheduler ( )
inline

Get a pointer to the FrameScheduler that owns this resource.

This is not required very often by application code, but is used in places in this scheduler library. This is primarily used to gain access to commitable parts of double buffered resources. This pointer does not confer ownership.

Returns
A pointer to the FrameScheduler that owns this resource.

Definition at line 181 of file doublebufferedresource.h.

template<typename DBR >
DBR& Mezzanine::Threading::ThreadSpecificStorage::GetResource ( const Whole ResourceID)
inline

Get a Specific kind of double buffered resource.

Parameters
ResourceIDThe ID the resource provided.
Returns
A reference to the resource if it exists, or undefined behavior and maybe an exception if it doesn't.

Definition at line 166 of file doublebufferedresource.h.

Logger& Mezzanine::Threading::ThreadSpecificStorage::GetUsableLogger ( )
inline

Get the usable logger for this thread specific resource.

Returns
A reference to the logger.
Note
A function like this should be provided for any other resources added to derived versions of this class. This encourages getting resources for this thread, and not providing a method to get the commitable resource gently discourages doing it unless its really required.

Definition at line 172 of file doublebufferedresource.h.


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