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.
decltype(auto) GetSystems ()
 Gets the list of systems in the container.
decltype(auto) DeleteSystem (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)
inlineprivate

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)
inline

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
Todo
Put the implementation in the inl file

◆ DeleteSystem()

decltype(auto) Engine::SystemContainer::DeleteSystem ( const FunctionUtils::FunctionID & id)
inline

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
Todo
Put the implementation in the cpp file, (remove inline)

◆ GetSystems()

decltype(auto) Engine::SystemContainer::GetSystems ( )
inline

Gets the list of systems in the container.

Returns
Const reference to the vector of unique pointers to SystemBase.
Todo
Put the implementation in the cpp file, (remove inline)

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