3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 02:15:19 +00:00
z3/lib/cancel_eh.h
Leonardo de Moura e9eab22e5c Z3 sources
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-02 11:35:25 -07:00

38 lines
585 B
C++

/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
cancel_eh.h
Abstract:
Template for implementing simple event handler that just invokes cancel method.
Author:
Leonardo de Moura (leonardo) 2011-04-27.
Revision History:
--*/
#ifndef _CANCEL_EH_H_
#define _CANCEL_EH_H_
#include"event_handler.h"
/**
\brief Generic event handler for invoking cancel method.
*/
template<typename T>
class cancel_eh : public event_handler {
T & m_obj;
public:
cancel_eh(T & o):m_obj(o) {}
virtual void operator()() {
m_obj.cancel();
}
};
#endif