CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBAutoModule.hpp
Go to the documentation of this file.
1 #pragma once
3 namespace CYB {
4  namespace Platform {
5  namespace Modules {
11  template <bool AOptionalFunctions, unsigned int AN> class AutoModuleOptionalHelpers {};
17  template <bool AOptionalFunctions, unsigned int AN, typename... AFunctionTypes> class AutoModule : private AutoModuleOptionalHelpers<AOptionalFunctions, AN> {
18  ENABLE_TEST_HOOKS
19  public:
20  using FParameterPack = API::ParameterPack<AFunctionTypes...>;
21  private:
23  void* FFunctionPointers[AN];
24  private:
29  static constexpr const char* ModuleName(void);
36  static const API::String::Static* OverridenNames(void) noexcept;
43  static const API::String::Static* FunctionNames(void) noexcept;
44  public:
49  static constexpr bool OptionalFunctions(void);
57  AutoModule();
58  AutoModule(AutoModule&& AMove);
59  AutoModule& operator=(AutoModule&& AMove);
60  ~AutoModule();
61 
69  template <class AIndexClass> bool Loaded(void) const noexcept;
70 
81  template<class AIndexClass, typename... AArgs> auto Call(AArgs&&... AArguments) const;
82  };
83  };
84  };
85 };
Encompasses a handle on loaded modules.
Definition: CYBModule.hpp:7
static const API::String::Static * OverridenNames(void) noexcept
Template for overriding the names of certain functions at compile time.
static const API::String::Static * FunctionNames(void) noexcept
The names of the functions associated with this AutoModule. Must be implemented;. ...
A string pointing to unchanging data in the stack above it or the data segment. Must have UTF-8 encod...
Definition: StaticString.hpp:7
AutoModule external helper for functions that rely on the state of AOptionalFunctions.
Automated intialization, function loading, and calling of module functions.
auto Call(AArgs &&...AArguments) const
Call a loaded function.
static constexpr bool OptionalFunctions(void)
Checks if functions loaded for this auto module will be optional. If true functions should be checked...
Module FModule
The owned module.
static constexpr const char * ModuleName(void)
Get the library name for this auto module. Must be implemented.
bool Loaded(void) const noexcept
Check if a function is loaded.
void * FFunctionPointers[AN]
Pointers to loaded functions.
Contains information about a template parameter pack.