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