stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::Recycler< T, B > Class Template Referencefinal

Recycling factory for shared_ptr wrapped classes. More...

Inheritance diagram for stmg::Recycler< T, B >:
Inheritance graph
[legend]

Public Member Functions

 Recycler () noexcept=default
 
template<typename ... P>
void create (shared_ptr< B > &refOutB, P &&... oParam)
 Construct or recycle the shared_ptr wrapped instance of T. More...
 

Detailed Description

template<class T, class B = T>
class stmg::Recycler< T, B >

Recycling factory for shared_ptr wrapped classes.

Constructor & Destructor Documentation

◆ Recycler()

template<class T, class B = T>
stmg::Recycler< T, B >::Recycler ( )
defaultnoexcept

Member Function Documentation

◆ create()

template<class T, class B = T>
template<typename ... P>
void stmg::Recycler< T, B >::create ( shared_ptr< B > &  refOutB,
P &&...  oParam 
)
inline

Construct or recycle the shared_ptr wrapped instance of T.

T must be same or subclass of B. T must have a constructor T(P&& ... oParam) and public member function reInit(P&& ... oParam) with the same params.