function.hh 700 Bytes
Newer Older
1
2
3
#ifndef RADIX_RADIXDL_FUNCTION_HH_
#define RADIX_RADIXDL_FUNCTION_HH_

4
5
#include <algorithm>

6
#if defined(_WIN32) && !defined(__GNUC__)
7
8
9
#include <windows.h>
#endif

10
#include "radixcore/visibility.hh"
11
12
#if defined(_WIN32)
#include "windef.h"
13
#endif
14

15
16
namespace radix
{
17
template <typename return_type, typename... ARGS>
18
19
class RADIX_PUBLIC DLFunction
{
20
21
22
 public:
#if defined(_WIN32)
  DLFunction(FARPROC = nullptr);
23
#else
24
  DLFunction(void * = nullptr);
25
#endif
26
  virtual ~DLFunction();
27

28
  return_type operator()(ARGS...);
29

30
31
32
 private:
#if defined(_WIN32)
  FARPROC mFunction;
33
#else
34
  void *mFunction;
35
36
37
#endif
};

38
}  // namespace radix
39
40
41
42

#include "radixdl/function.i.hh"

#endif /* RADIX_RADIXDL_FUNCTION_HH_ */