AGXDynamics  2.31.1.0
Delegate.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 
20 /*
21 A delegates is a type callback with some restrictions to allow for a more
22 performant implementation. While the agx::Callback class support things such as
23 lambdas and bound arguments, a delegate only accept either a free function
24 pointer or a member function pointer and an object to call the member function
25 on.
26 */
27 
28 
29 #define AGX_USE_DELEGATES 0
30 
31 #if AGX_USE_DELEGATES
32 #include <external/delegates/delegate.h>
33 #else
34 #include <agx/Callback.h>
35 #endif
36 
37 namespace agx
38 {
39  class RangeJob;
40 
41 #if AGX_USE_DELEGATES
42  using Delegate = delegates::delegate<void()>;
43  using RangeDelegate = delegates::delegate<void(const RangeJob&)>;
44 #else
47 #endif
48 }
49 
50 
agx::Callback1< const RangeJob & > RangeDelegate
Definition: Delegate.h:46
Generalized callback, using std::function.
Definition: Callback.h:53
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
Templated callback with one argument.
Definition: Callback.h:100
agx::Callback Delegate
Definition: Delegate.h:45