source: stable/1.17/Clp/src/ClpEventHandler.cpp @ 2438

Last change on this file since 2438 was 2438, checked in by forrest, 3 months ago

try and fix event handler

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1/* $Id: ClpEventHandler.cpp 2438 2019-03-26 12:39:54Z 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// Copy constructor
25//-------------------------------------------------------------------
26ClpEventHandler::ClpEventHandler(const ClpEventHandler &rhs)
27  : model_(rhs.model_)
28{
29}
30
31//-------------------------------------------------------------------
32// Destructor
33//-------------------------------------------------------------------
34ClpEventHandler::~ClpEventHandler()
35{
36}
37
38//----------------------------------------------------------------
39// Assignment operator
40//-------------------------------------------------------------------
41ClpEventHandler &
42ClpEventHandler::operator=(const ClpEventHandler &rhs)
43{
44  if (this != &rhs) {
45    model_ = rhs.model_;
46  }
47  return *this;
48}
49// Clone
50ClpEventHandler *
51ClpEventHandler::clone() const
52{
53  return new ClpEventHandler(*this);
54}
55// Event
56int ClpEventHandler::event(Event whichEvent)
57{
58
59  assert (!model_||model_->eventHandler()==this);
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 ClpEventHandler::eventWithInfo(Event whichEvent, void *info)
69{
70  return -1;
71}
72/* set model. */
73void ClpEventHandler::setSimplex(ClpSimplex *model)
74{
75  model_ = model;
76}
77//#############################################################################
78// Constructors / Destructor / Assignment
79//#############################################################################
80
81//-------------------------------------------------------------------
82// Default Constructor
83//-------------------------------------------------------------------
84ClpDisasterHandler::ClpDisasterHandler(ClpSimplex *model)
85  : model_(model)
86{
87}
88
89//-------------------------------------------------------------------
90// Copy constructor
91//-------------------------------------------------------------------
92ClpDisasterHandler::ClpDisasterHandler(const ClpDisasterHandler &rhs)
93  : model_(rhs.model_)
94{
95}
96
97//-------------------------------------------------------------------
98// Destructor
99//-------------------------------------------------------------------
100ClpDisasterHandler::~ClpDisasterHandler()
101{
102}
103
104//----------------------------------------------------------------
105// Assignment operator
106//-------------------------------------------------------------------
107ClpDisasterHandler &
108ClpDisasterHandler::operator=(const ClpDisasterHandler &rhs)
109{
110  if (this != &rhs) {
111    model_ = rhs.model_;
112  }
113  return *this;
114}
115/* set model. */
116void ClpDisasterHandler::setSimplex(ClpSimplex *model)
117{
118  model_ = model;
119}
120// Type of disaster 0 can fix, 1 abort
121int ClpDisasterHandler::typeOfDisaster()
122{
123  return 0;
124}
125
126/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
127*/
Note: See TracBrowser for help on using the repository browser.