Ignore:
Timestamp:
Aug 2, 2007 4:54:05 AM (12 years ago)
Author:
forrest
Message:

fix so will link on Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CoinSolve.cpp

    r716 r718  
    1313#include <cstring>
    1414#include <iostream>
     15  // define TEST_MESSAGE_HANDLER to check works on all messages
     16  //#define TEST_MESSAGE_HANDLER
     17#ifdef TEST_MESSAGE_HANDLER
    1518// This driver shows how to trap messages - this is just as in unitTest.cpp
    1619// ****** THis code is similar to MyMessageHandler.hpp and MyMessagehandler.cpp
     
    2629class CbcModel;
    2730
    28 class MyMessageHandler : public CoinMessageHandler {
     31class MyMessageHandler2 : public CoinMessageHandler {
    2932 
    3033public:
     
    4346  //@{
    4447  /** Default constructor. */
    45   MyMessageHandler();
     48  MyMessageHandler2();
    4649  /// Constructor with pointer to model
    47   MyMessageHandler(CbcModel * model,
     50  MyMessageHandler2(CbcModel * model,
    4851                           FILE * userPointer=NULL);
    4952  /** Destructor */
    50   virtual ~MyMessageHandler();
     53  virtual ~MyMessageHandler2();
    5154  //@}
    5255
     
    5457  //@{
    5558  /** The copy constructor. */
    56   MyMessageHandler(const MyMessageHandler&);
     59  MyMessageHandler2(const MyMessageHandler2&);
    5760  /** The copy constructor from an CoinSimplexMessageHandler. */
    58   MyMessageHandler(const CoinMessageHandler&);
     61  MyMessageHandler2(const CoinMessageHandler&);
    5962 
    60   MyMessageHandler& operator=(const MyMessageHandler&);
     63  MyMessageHandler2& operator=(const MyMessageHandler2&);
    6164  /// Clone
    6265  virtual CoinMessageHandler * clone() const ;
     
    8184// Default Constructor
    8285//-------------------------------------------------------------------
    83 MyMessageHandler::MyMessageHandler ()
     86MyMessageHandler2::MyMessageHandler2 ()
    8487  : CoinMessageHandler(),
    8588    model_(NULL)
     
    9093// Copy constructor
    9194//-------------------------------------------------------------------
    92 MyMessageHandler::MyMessageHandler (const MyMessageHandler & rhs)
     95MyMessageHandler2::MyMessageHandler2 (const MyMessageHandler2 & rhs)
    9396: CoinMessageHandler(rhs),
    9497    model_(rhs.model_)
     
    9699}
    97100
    98 MyMessageHandler::MyMessageHandler (const CoinMessageHandler & rhs)
     101MyMessageHandler2::MyMessageHandler2 (const CoinMessageHandler & rhs)
    99102  : CoinMessageHandler(),
    100103    model_(NULL)
     
    103106
    104107// Constructor with pointer to model
    105 MyMessageHandler::MyMessageHandler(CbcModel * model,
     108MyMessageHandler2::MyMessageHandler2(CbcModel * model,
    106109               FILE * userPointer)
    107110  : CoinMessageHandler(),
     
    113116// Destructor
    114117//-------------------------------------------------------------------
    115 MyMessageHandler::~MyMessageHandler ()
     118MyMessageHandler2::~MyMessageHandler2 ()
    116119{
    117120}
     
    120123// Assignment operator
    121124//-------------------------------------------------------------------
    122 MyMessageHandler &
    123 MyMessageHandler::operator=(const MyMessageHandler& rhs)
     125MyMessageHandler2 &
     126MyMessageHandler2::operator=(const MyMessageHandler2& rhs)
    124127{
    125128  if (this != &rhs) {
     
    132135// Clone
    133136//-------------------------------------------------------------------
    134 CoinMessageHandler * MyMessageHandler::clone() const
    135 {
    136   return new MyMessageHandler(*this);
     137CoinMessageHandler * MyMessageHandler2::clone() const
     138{
     139  return new MyMessageHandler2(*this);
    137140}
    138141int
    139 MyMessageHandler::print()
     142MyMessageHandler2::print()
    140143{
    141144  // Just add ==
     
    145148}
    146149const CbcModel *
    147 MyMessageHandler::model() const
     150MyMessageHandler2::model() const
    148151{
    149152  return model_;
    150153}
    151154void
    152 MyMessageHandler::setModel(CbcModel * model)
     155MyMessageHandler2::setModel(CbcModel * model)
    153156{
    154157  model_ = model;
    155158}
     159#endif
    156160//#############################################################################
    157161// To use USERCBC or USERCLP change 0 to 1 in defines and add in your fake main program(s) and any other code
     
    191195  OsiClpSolverInterface solver1;
    192196  CbcModel model(solver1);
    193   // define TEST_MESSAGE_HANDLER to check works on all messages
    194   //#define TEST_MESSAGE_HANDLER
     197  // define TEST_MESSAGE_HANDLER at top of file to check works on all messages
    195198#ifdef TEST_MESSAGE_HANDLER
    196   MyMessageHandler messageHandler(&model);
     199  MyMessageHandler2 messageHandler(&model);
    197200  std::cout<<"Testing derived message handler"<<std::endl;
    198201  model.passInMessageHandler(&messageHandler);
Note: See TracChangeset for help on using the changeset viewer.