source: trunk/Clp/src/ClpEventHandler.cpp @ 2385

Last change on this file since 2385 was 2385, checked in by unxusr, 4 months ago

formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1/* $Id: ClpEventHandler.cpp 2385 2019-01-06 19:43:06Z unxusr $ */
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  if (whichEvent != theta)
59    return -1; // do nothing
60  else
61    return 0; // say normal exit
62}
63/* This can do whatever it likes.  Return code -1 means no action.
64   This passes in something
65*/
66int ClpEventHandler::eventWithInfo(Event whichEvent, void *info)
67{
68  return -1;
69}
70/* set model. */
71void ClpEventHandler::setSimplex(ClpSimplex *model)
72{
73  model_ = model;
74}
75//#############################################################################
76// Constructors / Destructor / Assignment
77//#############################################################################
78
79//-------------------------------------------------------------------
80// Default Constructor
81//-------------------------------------------------------------------
82ClpDisasterHandler::ClpDisasterHandler(ClpSimplex *model)
83  : model_(model)
84{
85}
86
87//-------------------------------------------------------------------
88// Copy constructor
89//-------------------------------------------------------------------
90ClpDisasterHandler::ClpDisasterHandler(const ClpDisasterHandler &rhs)
91  : model_(rhs.model_)
92{
93}
94
95//-------------------------------------------------------------------
96// Destructor
97//-------------------------------------------------------------------
98ClpDisasterHandler::~ClpDisasterHandler()
99{
100}
101
102//----------------------------------------------------------------
103// Assignment operator
104//-------------------------------------------------------------------
105ClpDisasterHandler &
106ClpDisasterHandler::operator=(const ClpDisasterHandler &rhs)
107{
108  if (this != &rhs) {
109    model_ = rhs.model_;
110  }
111  return *this;
112}
113/* set model. */
114void ClpDisasterHandler::setSimplex(ClpSimplex *model)
115{
116  model_ = model;
117}
118// Type of disaster 0 can fix, 1 abort
119int ClpDisasterHandler::typeOfDisaster()
120{
121  return 0;
122}
123
124/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
125*/
Note: See TracBrowser for help on using the repository browser.