Register< T > Struct Template Reference
SPADES API
|
Public Member Functions |
Static Public Member Functions |
Public Attributes |
Static Public Attributes |
Private Member Functions |
List of all members
spades::Factory< Base, Args >::Register< T > Struct Template Reference
Class to handle registration of subclass for runtime selection. More...
#include <Factory.H>
Inheritance diagram for spades::Factory< Base, Args >::Register< T >:
Collaboration diagram for spades::Factory< Base, Args >::Register< T >:
Public Member Functions | |
~Register () override | |
Static Public Member Functions | |
static bool | add_sub_type () |
Public Attributes | |
friend | T |
Static Public Attributes | |
static bool | registered |
Private Member Functions | |
Register () | |
Detailed Description
template<class Base, class... Args>
template<class T>
struct spades::Factory< Base, Args >::Register< T >
template<class T>
struct spades::Factory< Base, Args >::Register< T >
Class to handle registration of subclass for runtime selection.
Constructor & Destructor Documentation
◆ ~Register()
template<class Base , class... Args>
template<class T >
|
inlineoverride |
113 {
116 const auto& it = tbl.find(T::identifier());
117 registered = (it != tbl.end());
118 }
119 }
static LookupTable & table()
Lookup table containing all registered instances.
Definition Factory.H:150
Here is the call graph for this function:
◆ Register()
template<class Base , class... Args>
template<class T >
|
inlineprivate |
122{ (void)registered; }
Member Function Documentation
◆ add_sub_type()
template<class Base , class... Args>
template<class T >
|
inlinestatic |
102 {
103 // TODO: Add checks against multiple registration
104 Factory::table()[T::identifier()] =
105 [](Args... args) -> std::unique_ptr<Base> {
106 return std::unique_ptr<Base>(
108 };
109 return true;
110 }
Here is the call graph for this function:
Member Data Documentation
◆ registered
template<class Base , class... Args>
template<class T >
|
static |
Initial value:
=
◆ T
template<class Base , class... Args>
template<class T >
friend spades::Factory< Base, Args >::Register< T >::T |
The documentation for this struct was generated from the following file:
- /home/runner/work/spades/spades/Source/Factory.H
Generated by