Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem > Class Template Reference

#include <Engine/Scene/CouplingSystem.hpp>

+ Collaboration diagram for Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >:

Public Types

using BaseAbstractSystem = _BaseAbstractSystem
 

Public Member Functions

 BaseCouplingSystem (const BaseCouplingSystem< BaseAbstractSystem > &)=delete
 
BaseCouplingSystem< BaseAbstractSystem > & operator= (const BaseCouplingSystem< BaseAbstractSystem > &)=delete
 
void addSystem (BaseAbstractSystem *s)
 
void generateTasks (Core::TaskQueue *taskQueue, const Engine::FrameInfo &frameInfo) override
 
void handleAssetLoading (Entity *entity, const Core::Asset::FileData *data) override
 

Protected Member Functions

template<typename Functor >
void dispatch (Functor f)
 
template<typename Functor >
void dispatch (Functor f) const
 
template<typename Functor >
bool conditionnaldispatch (Functor f, bool abortWhenInvalid=true)
 
template<typename Functor >
bool conditionnaldispatch (Functor f, bool abortWhenInvalid=true) const
 

Detailed Description

template<typename _BaseAbstractSystem>
class Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >

Base class for systems coupling multiple subsystems.

Provides subsystem storage + dispatching methods for inheriting classes. Also dispatches by default the generateTasks() and handleAssetLoading() methods from Ra::Engine::System. Note that Ra::Engine::Component registration methods from Ra::Engine::System are not dispatched by default, Ra::Engine::Systems managing only their own Ra::Engine::Components.

See also
CoupledTimedSystem for practical usage
Template Parameters
BaseAbstractSystemBase class defining the subsystems API
Warning
When overriding non pure virtual methods from BaseAbstractSystem, remind calling the default implementation:
inline void generateTasks( Core::TaskQueue* taskQueue, const Engine::FrameInfo& frameInfo )
override {
dispatch( [taskQueue, &frameInfo]( const auto& s ) {
s->generateTasks( taskQueue, frameInfo );
} );
}
This class allows tasks to be registered and then executed in parallel on separate threads.
Definition TaskQueue.hpp:48
Structure passed to each system before they fill the task queue.
Definition FrameInfo.hpp:8

Definition at line 37 of file CouplingSystem.hpp.

Member Typedef Documentation

◆ BaseAbstractSystem

template<typename _BaseAbstractSystem >
using Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::BaseAbstractSystem = _BaseAbstractSystem

Definition at line 40 of file CouplingSystem.hpp.

Constructor & Destructor Documentation

◆ BaseCouplingSystem()

template<typename _BaseAbstractSystem >
Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::BaseCouplingSystem ( )
inline

Definition at line 42 of file CouplingSystem.hpp.

Member Function Documentation

◆ addSystem()

template<typename _BaseAbstractSystem >
void Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::addSystem ( BaseAbstractSystem * s)
inline

Add management for the given system.

Warning
The property of the pointer is given to *this

Definition at line 54 of file CouplingSystem.hpp.

+ Here is the call graph for this function:

◆ conditionnaldispatch() [1/2]

template<typename _BaseAbstractSystem >
template<typename Functor >
bool Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::conditionnaldispatch ( Functor f,
bool abortWhenInvalid = true )
inlineprotected

Call a functor on subsystems, and combine return status. Loop is stopped when combined status is false.

Template Parameters
FunctorUnary function object class calling the method to be dispatched on a system
Parameters
finput functor
abortWhenInvalidStop dispatching if a subsystem call returns false
Returns
false when dispatch is aborted
See also
CoupledTimedSystem for practical usage

Definition at line 110 of file CouplingSystem.hpp.

◆ conditionnaldispatch() [2/2]

template<typename _BaseAbstractSystem >
template<typename Functor >
bool Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::conditionnaldispatch ( Functor f,
bool abortWhenInvalid = true ) const
inlineprotected
See also
conditionnaldispatch

Definition at line 119 of file CouplingSystem.hpp.

◆ dispatch() [1/2]

template<typename _BaseAbstractSystem >
template<typename Functor >
void Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::dispatch ( Functor f)
inlineprotected

Call a functor on subsystems

See also
CoupledTimedSystem for practical usage

Definition at line 71 of file CouplingSystem.hpp.

◆ dispatch() [2/2]

template<typename _BaseAbstractSystem >
template<typename Functor >
void Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::dispatch ( Functor f) const
inlineprotected

Call a functor on subsystems (const version)

See also
CoupledTimedSystem for practical usage

Definition at line 79 of file CouplingSystem.hpp.

◆ generateTasks()

template<typename _BaseAbstractSystem >
void Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::generateTasks ( Core::TaskQueue * taskQueue,
const Engine::FrameInfo & frameInfo )
inlineoverride

Definition at line 56 of file CouplingSystem.hpp.

◆ handleAssetLoading()

template<typename _BaseAbstractSystem >
void Ra::Engine::Scene::BaseCouplingSystem< _BaseAbstractSystem >::handleAssetLoading ( Entity * entity,
const Core::Asset::FileData * data )
inlineoverride

Definition at line 62 of file CouplingSystem.hpp.


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