Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | List of all members
Mezzanine::Threading::LogAggregator Class Reference

Gather all the thread specific logs and commit them to the main log. More...

#include <frameschedulerworkunits.h>

+ Inheritance diagram for Mezzanine::Threading::LogAggregator:
+ Collaboration diagram for Mezzanine::Threading::LogAggregator:

Public Member Functions

 LogAggregator ()
 Create a default log agregator with no target.
 
virtual ~LogAggregator ()
 Virtual Deconstructor.
 
virtual void DoWork (DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
 This does the actual work of log aggregation. More...
 
FrameSchedulerGetAggregationTarget () const
 Get the current Aggregation Target. More...
 
void NextFlushForced (Boole Force=true)
 Used to indicate the next log flush is abnormally forced. More...
 
void SetAggregationTarget (FrameScheduler *NewTarget)
 Set which framescheduler will be aggregated. More...
 
- Public Member Functions inherited from Mezzanine::Threading::DefaultWorkUnit
 DefaultWorkUnit ()
 Simple constructor.
 
virtual ~DefaultWorkUnit ()
 Virtual destructor, doesn't actually do much.
 
virtual void AddDependency (iWorkUnit *NewDependency)
 Force this WorkUnit to Start after another has completed. More...
 
virtual void ClearDependencies ()
 Drop any information about what work units this one depends on.
 
virtual iWorkUnitGetDependency (Whole Index) const
 This is used to iterate of all the dependencies. More...
 
virtual Whole GetDependencyCount () const
 How many other WorkUnits does this one depend on? More...
 
virtual Whole GetDependentCount (FrameScheduler &SchedulerToCount)
 This returns the count workunits that depend on this work unit. More...
 
virtual Whole GetImmediateDependencyCount () const
 Get the amount of dependencies that directly count on this for access purposes. More...
 
virtual Whole GetPerformance () const
 Get the internal rolling average for querying. More...
 
virtual RollingAverage< Whole > & GetPerformanceLog ()
 Get the internal rolling average for querying. More...
 
virtual RunningState GetRunningState () const
 Retrieves the current RunningState of the thread. More...
 
virtual WorkUnitKey GetSortingKey (FrameScheduler &SchedulerToCount)
 Get the sorting metadata. More...
 
virtual bool IsEveryDependencyComplete ()
 Check if this WorkUnit could concievably run right now. More...
 
virtual void operator() (DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
 This does everything required to track metadata and log work. More...
 
virtual void PrepareForNextFrame ()
 This resets the running state and takes any further action required to use the WorkUnit again.
 
virtual void RemoveDependency (iWorkUnit *RemoveDependency)
 Remove a dependency. More...
 
virtual RunningState TakeOwnerShip ()
 Attempts to atomically start the work unit in the current thread. More...
 
- Public Member Functions inherited from Mezzanine::Threading::iWorkUnit
virtual ~iWorkUnit ()
 Virtual destructor.
 

Additional Inherited Members

- Protected Attributes inherited from Mezzanine::Threading::DefaultWorkUnit
Int32 CurrentRunningState
 This controls do work with this after it has.
 
std::vector< iWorkUnit * > Dependencies
 A collection of of workunits that must be complete before this one can start.
 
DefaultRollingAverage< Whole >::Type PerformanceLog
 A rolling average of execution times.
 

Detailed Description

Gather all the thread specific logs and commit them to the main log.

All the logs are double buffered. This reads from the commitable buffer which should otherwise be unused. This task was separated from the log swapper top minimize contention.

Definition at line 65 of file frameschedulerworkunits.h.

Member Function Documentation

void Mezzanine::Threading::LogAggregator::DoWork ( DefaultThreadSpecificStorage::Type CurrentThreadStorage)
virtual

This does the actual work of log aggregation.

Parameters
CurrentThreadStorageThis is used to retrieve the framescheduler that will have its log aggregated.

If there is no currently set aggregation target this sets it to whatever scheduler is in the passed ThreadSpecificStorage

Implements Mezzanine::Threading::iWorkUnit.

Definition at line 67 of file frameschedulerworkunits.cpp.

FrameScheduler * Mezzanine::Threading::LogAggregator::GetAggregationTarget ( ) const

Get the current Aggregation Target.

Returns
A FrameScheduler pointer or NULL if one is not set

Definition at line 97 of file frameschedulerworkunits.cpp.

void Mezzanine::Threading::LogAggregator::NextFlushForced ( Boole  Force = true)

Used to indicate the next log flush is abnormally forced.

Parameters
ForceCan be passed to unset the abnormal log flush.

Definition at line 63 of file frameschedulerworkunits.cpp.

void Mezzanine::Threading::LogAggregator::SetAggregationTarget ( FrameScheduler NewTarget)

Set which framescheduler will be aggregated.

Parameters
NewTargetA pointer to the FrameScheduler to aggregate.

If set to NULL this will use whatever FrameScheduler is in the next ThreadSpecificStorage passed during DoWork. This will never delete a framescheduler.

Definition at line 100 of file frameschedulerworkunits.cpp.


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