Celero
Exceptions.h
1 #pragma once
2 
20 
21 #include <celero/TestFixture.h>
22 #include <cstdint>
23 #include <utility>
24 
25 namespace celero
26 {
31  {
32  public:
36  static bool GetCatchExceptions();
37 
41  static void SetCatchExceptions(bool catchExceptions);
42 
43  private:
44  static ExceptionSettings& instance();
45 
46  private:
47  bool catchExceptions{true};
48  };
49 
53  std::pair<bool, uint64_t> RunAndCatchSEHExc(TestFixture& test, uint64_t threads, uint64_t calls,
54  std::shared_ptr<celero::TestFixture::ExperimentValue> experimentValue);
55 
59  std::pair<bool, uint64_t> RunAndCatchExc(TestFixture& test, uint64_t threads, uint64_t calls,
60  std::shared_ptr<celero::TestFixture::ExperimentValue> experimentValue);
61 } // namespace celero
62 
Definition: TestFixture.h:44
static void SetCatchExceptions(bool catchExceptions)
Set a flag indicating whether Celero should catch exceptions or not.
Definition: Exceptions.cpp:95
Definition: Archive.h:25
std::pair< bool, uint64_t > RunAndCatchSEHExc(TestFixture &test, uint64_t threads, uint64_t calls, std::shared_ptr< celero::TestFixture::ExperimentValue > experimentValue)
Run test and catch SEH exceptions if they are supported by compiler.
Definition: Exceptions.cpp:202
static bool GetCatchExceptions()
Get a flag indicating whether Celero should catch exceptions or not.
Definition: Exceptions.cpp:90
A Singleton storing exception settings (currently only one flag)
Definition: Exceptions.h:30
std::pair< bool, uint64_t > RunAndCatchExc(TestFixture &test, uint64_t threads, uint64_t calls, std::shared_ptr< celero::TestFixture::ExperimentValue > experimentValue)
Run test and catch all exceptions we can.
Definition: Exceptions.cpp:234