Program Listing for File sigint-breaker.h

Return to documentation for file (common/maplab-common/include/maplab-common/sigint-breaker.h)

#ifndef MAPLAB_COMMON_SIGINT_BREAKER_H_
#define MAPLAB_COMMON_SIGINT_BREAKER_H_

namespace common {

class SigintBreaker {
 public:
  SigintBreaker();
  ~SigintBreaker();
  bool isBreakRequested() const;

 private:
  static void handler(int signal);

  static bool is_instantiated_;
  static bool is_sigint_raised_;
  void (*previous_handler_)(int);  // NOLINT
};

}  // namespace common

#endif  // MAPLAB_COMMON_SIGINT_BREAKER_H_