Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Engine::SystemContainer Class Reference

Container class for managing multiple systems. More...

#include <System.hpp>

Inheritance diagram for Engine::SystemContainer:
FunctionUtils::FunctionContainer< void, Core & >

Public Member Functions

template<typename... TSystem>
decltype(auto) AddSystems (TSystem... systems)
 Adds systems to the container.
const std::list< std::unique_ptr< SystemBase > > & GetSystems ()
 Gets the list of systems in the container.
std::unique_ptr< SystemBaseDeleteSystem (const FunctionUtils::FunctionID &id)
 Deletes a system from the container by its FunctionID.
Public Member Functions inherited from FunctionUtils::FunctionContainer< void, Core & >
FunctionUtils::FunctionID AddFunction (TCallable callable)
 FunctionContainer ()=default
 Default constructor for FunctionContainer.
 ~FunctionContainer ()=default
 Default destructor for FunctionContainer.
FunctionContaineroperator= (const FunctionContainer &)=delete
 Deleted copy assignment (FunctionContainer is not copyable due to unique_ptr).
decltype(auto) AddFunctions (TFunctions... functions)
 Adds multiple functions to the container.
const std::list< std::unique_ptr< FunctionType > > & GetFunctions ()
 Gets the list of functions in the container.
bool IsEmpty () const
 Returns true if the container is empty.
std::size_t Size () const
 Returns the number of functions in the container.
std::unique_ptr< FunctionTypeDeleteFunction (FunctionID id)
 Deletes a function from the container.
bool Contains (FunctionID id) const

Private Member Functions

template<typename TCallable>
void AddSystem (TCallable callable)
 Add a system to the container.

Additional Inherited Members

Public Types inherited from FunctionUtils::FunctionContainer< void, Core & >
using FunctionType

Detailed Description

Container class for managing multiple systems.

See also
FunctionUtils::FunctionContainer

Member Function Documentation

◆ AddSystem()

template<typename TCallable>
void Engine::SystemContainer::AddSystem ( TCallable callable)
private

Add a system to the container.

Template Parameters
TCallableType of the callable system.
Parameters
callableThe callable system to be added.
See also
FunctionUtils::CallableFunction

◆ AddSystems()

template<typename... TSystem>
decltype(auto) Engine::SystemContainer::AddSystems ( TSystem... systems)

Adds systems to the container.

Template Parameters
...TSystemSystems types to add.
Parameters
...systemsSystems to add.
Returns
a tuple of FunctionIDs for the added systems.
See also
FunctionUtils::FunctionID

◆ DeleteSystem()

std::unique_ptr< SystemBase > Engine::SystemContainer::DeleteSystem ( const FunctionUtils::FunctionID & id)

Deletes a system from the container by its FunctionID.

Parameters
idThe FunctionID of the system to delete.
Returns
A unique pointer to the deleted system, or nullptr if not found.
See also
FunctionUtils::FunctionID

◆ GetSystems()

const std::list< std::unique_ptr< SystemBase > > & Engine::SystemContainer::GetSystems ( )

Gets the list of systems in the container.

Returns
Const reference to the vector of unique pointers to SystemBase.

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