Skip to content

Commit aa89c0c

Browse files
committed
Supporting SequencerLite for C++14 and above
Signed-off-by: Denis Mindolin <[email protected]>
1 parent b2650bf commit aa89c0c

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

quantum/util/impl/quantum_sequencer_lite_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <quantum/quantum_promise.h>
2424
#include <quantum/quantum_traits.h>
2525
#include <stdexcept>
26+
#include <tuple>
2627

2728
namespace Bloomberg {
2829
namespace quantum {

quantum/util/quantum_sequencer_lite.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
#ifndef BLOOMBERG_QUANTUM_SEQUENCER_LITE_H
1717
#define BLOOMBERG_QUANTUM_SEQUENCER_LITE_H
1818

19+
#if __cplusplus >= 201402L
20+
#define BLOOMBERG_QUANTUM_SEQUENCER_LITE_SUPPORT
21+
#endif // __cplusplus >= 201402L
22+
23+
#ifdef BLOOMBERG_QUANTUM_SEQUENCER_LITE_SUPPORT
24+
1925
#include <quantum/quantum_dispatcher.h>
2026
#include <quantum/interface/quantum_iqueue.h>
2127
#include <quantum/interface/quantum_ithread_context_base.h>
@@ -273,8 +279,7 @@ class SequencerLite
273279
enqueueAllImpl(void* opaque, int queueId, bool isHighPriority, FUNC&& func, ARGS&&... args);
274280

275281
template<class FUNC, class ...ARGS>
276-
static std::function<int(VoidContextPtr)> wrap(
277-
FUNC&& func, ARGS&&... args);
282+
static std::function<int(VoidContextPtr)> wrap(FUNC&& func, ARGS&&... args);
278283

279284
Dispatcher& _dispatcher;
280285
std::atomic_bool _drain;
@@ -289,4 +294,6 @@ class SequencerLite
289294

290295
#include <quantum/util/impl/quantum_sequencer_lite_impl.h>
291296

297+
#endif // BLOOMBERG_QUANTUM_SEQUENCER_LITE_SUPPORT
298+
292299
#endif //BLOOMBERG_QUANTUM_SEQUENCER_LITE_H

tests/quantum_sequencer_lite_tests.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
** See the License for the specific language governing permissions and
1414
** limitations under the License.
1515
*/
16+
1617
#include <quantum_fixture.h>
1718
#include <gtest/gtest.h>
1819

20+
#ifdef BLOOMBERG_QUANTUM_SEQUENCER_LITE_SUPPORT
21+
1922
using namespace quantum;
2023

2124
//==============================================================================
@@ -518,3 +521,5 @@ TEST_P(SequencerLiteTest, CustomHashFunction)
518521
}
519522
}
520523
}
524+
525+
#endif // BLOOMBERG_QUANTUM_SEQUENCER_LITE_SUPPORT

0 commit comments

Comments
 (0)