| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

FunctionCall.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <functional>
5 #include <tuple>
6
7 #include <globjects/globjects_api.h>
8
9 #include <globjects/base/AbstractFunctionCall.h>
10
11
12 namespace globjects
13 {
14
15
16 template <typename... Arguments>
17 class FunctionCall : public AbstractFunctionCall
18 {
19 public:
20 using FunctionPointer = void (*)(Arguments...);
21
22 FunctionCall();
23 FunctionCall(FunctionPointer function, Arguments... arguments);
24
25 virtual void operator()() override;
26 virtual void * identifier() const override;
27
28 protected:
29 mutable FunctionPointer m_functionPointer;
30 std::function<void(Arguments...)> m_function;
31 std::tuple<Arguments...> m_arguments;
32 };
33
34
35 } // namespace globjects
36
37
38 #include <globjects/base/FunctionCall.inl>
globjects::FunctionCall
Definition: FunctionCall.h:17
globjects::FunctionCall::m_arguments
std::tuple< Arguments... > m_arguments
Definition: FunctionCall.h:31
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::AbstractFunctionCall
The interface for a callable function with variadic argument types.
Definition: AbstractFunctionCall.h:17
globjects::FunctionCall::FunctionPointer
void(*)(Arguments...) FunctionPointer
Definition: FunctionCall.h:20
AbstractFunctionCall.h
globjects::FunctionCall::FunctionCall
FunctionCall()
globjects::FunctionCall::m_function
std::function< void(Arguments...)> m_function
Definition: FunctionCall.h:30
globjects::FunctionCall::identifier
virtual void * identifier() const override
Accessor for an arbitrary identifier that can be used as identity.
globjects::FunctionCall::operator()
virtual void operator()() override
Entry point for the main functionality of a subclass.
globjects::FunctionCall::m_functionPointer
FunctionPointer m_functionPointer
Definition: FunctionCall.h:29