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.
master
Lucas De Marchi 10 years ago committed by Andrew Tridgell
parent
commit
83efb9280b
  1. 8
      libraries/AP_HAL/AP_HAL_Namespace.h
  2. 1159
      libraries/AP_HAL/utility/FastDelegate.h

8
libraries/AP_HAL/AP_HAL_Namespace.h

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
#include "string.h"
#include "utility/FastDelegate.h"
#if defined(__AVR__)
#if defined(__AVR__)
/*
gcc on AVR doesn't allow for delegates in progmem. It gives a
warning that the progmem area is uninitialised, and fills the area
@ -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

1159
libraries/AP_HAL/utility/FastDelegate.h

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