source: stable/1.15/Clp/src/ClpEventHandler.cpp @ 1989

Last change on this file since 1989 was 1825, checked in by forrest, 8 years ago

stuff to allow more event handling

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1/* $Id: ClpEventHandler.cpp 1825 2011-11-20 16:02:57Z forrest $ */
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#include "CoinPragma.hpp"
7
8#include "ClpEventHandler.hpp"
9#include "ClpSimplex.hpp"
10
11//#############################################################################
12// Constructors / Destructor / Assignment
13//#############################################################################
14
15//-------------------------------------------------------------------
16// Default Constructor
17//-------------------------------------------------------------------
18ClpEventHandler::ClpEventHandler (ClpSimplex * model) :
19     model_(model)
20{
21
22}
23
24//-------------------------------------------------------------------
25// Copy constructor
26//-------------------------------------------------------------------
27ClpEventHandler::ClpEventHandler (const ClpEventHandler & rhs)
28     : model_(rhs.model_)
29{
30}
31
32//-------------------------------------------------------------------
33// Destructor
34//-------------------------------------------------------------------
35ClpEventHandler::~ClpEventHandler ()
36{
37}
38
39//----------------------------------------------------------------
40// Assignment operator
41//-------------------------------------------------------------------
42ClpEventHandler &
43ClpEventHandler::operator=(const ClpEventHandler& rhs)
44{
45     if (this != &rhs) {
46          model_ = rhs.model_;
47     }
48     return *this;
49}
50// Clone
51ClpEventHandler *
52ClpEventHandler::clone() const
53{
54     return new ClpEventHandler(*this);
55}
56// Event
57int
58ClpEventHandler::event(Event whichEvent)
59{
60     if (whichEvent != theta)
61          return -1; // do nothing
62     else
63          return 0; // say normal exit
64}
65/* This can do whatever it likes.  Return code -1 means no action.
66   This passes in something
67*/
68int 
69ClpEventHandler::eventWithInfo(Event whichEvent, void * info) 
70{ 
71  return -1;
72}
73/* set model. */
74void
75ClpEventHandler::setSimplex(ClpSimplex * model)
76{
77     model_ = model;
78}
79//#############################################################################
80// Constructors / Destructor / Assignment
81//#############################################################################
82
83//-------------------------------------------------------------------
84// Default Constructor
85//-------------------------------------------------------------------
86ClpDisasterHandler::ClpDisasterHandler (ClpSimplex * model) :
87     model_(model)
88{
89
90}
91
92//-------------------------------------------------------------------
93// Copy constructor
94//-------------------------------------------------------------------
95ClpDisasterHandler::ClpDisasterHandler (const ClpDisasterHandler & rhs)
96     : model_(rhs.model_)
97{
98}
99
100//-------------------------------------------------------------------
101// Destructor
102//-------------------------------------------------------------------
103ClpDisasterHandler::~ClpDisasterHandler ()
104{
105}
106
107//----------------------------------------------------------------
108// Assignment operator
109//-------------------------------------------------------------------
110ClpDisasterHandler &
111ClpDisasterHandler::operator=(const ClpDisasterHandler& rhs)
112{
113     if (this != &rhs) {
114          model_ = rhs.model_;
115     }
116     return *this;
117}
118/* set model. */
119void
120ClpDisasterHandler::setSimplex(ClpSimplex * model)
121{
122     model_ = model;
123}
124// Type of disaster 0 can fix, 1 abort
125int
126ClpDisasterHandler::typeOfDisaster()
127{
128     return 0;
129}
130
131
Note: See TracBrowser for help on using the repository browser.