Browse Source

AP_HAL: use variadic templates in FastDelegate

Now that we are using C++11 we can use variadic templates to simplify
the FastDelegate classes. It also simplifies moving away from the
FastDelegate implementation.
mission-4.1.18
Lucas De Marchi 10 years ago committed by Andrew Tridgell
parent
commit
83efb9280b
  1. 6
      libraries/AP_HAL/AP_HAL_Namespace.h
  2. 1149
      libraries/AP_HAL/utility/FastDelegate.h

6
libraries/AP_HAL/AP_HAL_Namespace.h

@ -24,8 +24,10 @@ @@ -24,8 +24,10 @@
#define AP_HAL_MEMBERPROC(func) AP_HAL_CLASSPROC(this, func)
#define DELEGATE_FUNCTION0(rettype) fastdelegate::FastDelegate0<rettype>
#define DELEGATE_FUNCTION1(rettype, args...) fastdelegate::FastDelegate1<args, rettype>
#define DELEGATE_FUNCTION2(rettype, args...) fastdelegate::FastDelegate2<args, rettype>
#define DELEGATE_FUNCTION1(rettype, args...) fastdelegate::FastDelegate0<rettype, args>
#define DELEGATE_FUNCTION2(rettype, args...) fastdelegate::FastDelegate0<rettype, args>
#define DELEGATE_FUNCTION(rettype, ...) fastdelegate::FastDelegate0<rettype, ## __VA_ARGS__>
#ifndef APM_BUILD_FUNCTOR
#define APM_BUILD_FUNCTOR 0

1149
libraries/AP_HAL/utility/FastDelegate.h

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save