00001 //Copyright (C) GAMS Development 2007 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // Authors : 00005 // Stefan Vigerske, Humboldt-University Berlin. 00006 // 00007 // Date : 04/01/2007 00008 00009 #ifndef __COINMESSAGEHANDLER2JOURNAL_HPP__ 00010 #define __COINMESSAGEHANDLER2JOURNAL_HPP__ 00011 00012 //#include "IpoptConfig.h" 00013 #include "IpTypes.hpp" 00014 #include "IpReferenced.hpp" 00015 #include "IpSmartPtr.hpp" 00016 #include "IpJournalist.hpp" 00017 #include "CoinMessageHandler.hpp" 00018 00019 //#ifdef HAVE_CSTDARG 00020 //# include <cstdarg> 00021 //#else 00022 //# ifdef HAVE_STDARG_H 00023 //# include <stdarg.h> 00024 //# else 00025 //# error "don't have header file for stdarg" 00026 //# endif 00027 //#endif 00028 00029 #include <string> 00030 //#include <vector> 00031 00032 using namespace Ipopt; 00033 00037 class CoinMessageHandler2Journal : public Journal { 00038 public: 00040 CoinMessageHandler2Journal(CoinMessageHandler* messagehandler_, const std::string& name, EJournalLevel default_level); 00041 00043 virtual ~CoinMessageHandler2Journal(); 00044 00045 void setMessageHandler(CoinMessageHandler* messagehandler_) { 00046 messagehandler=messagehandler_; 00047 } 00048 00049 protected: 00051 virtual void PrintImpl(EJournalCategory category, EJournalLevel level, const char* str); 00052 00054 virtual void PrintfImpl(EJournalCategory category, EJournalLevel level, const char* pformat, va_list ap); 00055 00057 virtual void FlushBufferImpl(); 00058 00059 private: 00061 CoinMessageHandler2Journal(); 00062 00064 CoinMessageHandler2Journal(const FileJournal&); 00065 00067 void operator=(const CoinMessageHandler2Journal&); 00068 00071 CoinMessageHandler* messagehandler; 00072 }; 00073 00074 #endif // __COINMESSAGEHANDLER2JOURNAL_HPP__ 00075 00076