| 1 | /* $Id: MyEventHandler.hpp 1665 2011-01-04 17:55:54Z lou $ */ |
| 2 | // Copyright (C) 2004, International Business Machines |
| 3 | // Corporation and others. All Rights Reserved. |
| 4 | // This code is licensed under the terms of the Eclipse Public License (EPL). |
| 5 | |
| 6 | #ifndef MyEventHandler_H |
| 7 | #define MyEventHandler_H |
| 8 | |
| 9 | #include "ClpEventHandler.hpp" |
| 10 | |
| 11 | /** This is so user can trap events and do useful stuff. |
| 12 | This is used in Clp/Test/unitTest.cpp |
| 13 | |
| 14 | ClpSimplex model_ is available as well as anything else you care |
| 15 | to pass in |
| 16 | */ |
| 17 | |
| 18 | class MyEventHandler : public ClpEventHandler { |
| 19 | |
| 20 | public: |
| 21 | /**@name Overrides */ |
| 22 | //@{ |
| 23 | virtual int event(Event whichEvent) override; |
| 24 | //@} |
| 25 | |
| 26 | /**@name Constructors, destructor etc*/ |
| 27 | //@{ |
| 28 | /** Default constructor. */ |
| 29 | MyEventHandler(); |
| 30 | /// Constructor with pointer to model (redundant as setEventHandler does) |
| 31 | MyEventHandler(ClpSimplex * model); |
| 32 | /** Destructor */ |
| 33 | virtual ~MyEventHandler(); |
| 34 | /** The copy constructor. */ |
| 35 | MyEventHandler(const MyEventHandler & rhs); |
| 36 | /// Assignment |
| 37 | MyEventHandler& operator=(const MyEventHandler & rhs); |
| 38 | /// Clone |
| 39 | virtual ClpEventHandler * clone() const override ; |
| 40 | //@} |
| 41 | |
| 42 | |
| 43 | protected: |
| 44 | // data goes here |
| 45 | }; |
| 46 | |
| 47 | #endif |
| 48 | |