SmagJournal.hpp

Go to the documentation of this file.
00001 // Copyright (C) GAMS Development 2007
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: SmagJournal.hpp 56 2007-02-03 17:51:56Z stefan $
00006 //
00007 // Author: Stefan Vigerske
00008 // from the IpFileJournal class in IPOPT
00009 
00010 #ifndef __SMAGJOURNAL_HPP__
00011 #define __SMAGJOURNAL_HPP__
00012 
00013 #include "GAMSlinksConfig.h"
00014 
00015 // smag.h will try to include stdio.h and stdarg.h
00016 // so we include cstdio and cstdarg before if we know that we have them
00017 #ifdef HAVE_CSTDIO
00018 #include <cstdio>
00019 #endif
00020 #ifdef HAVE_CSTDARG
00021 #include <cstdarg>
00022 #endif
00023 #include "smag.h"
00024 
00025 #include "IpJournalist.hpp"
00026 
00027 using namespace Ipopt;
00028 
00031 class SmagJournal : public Journal {
00032 public:
00035   SmagJournal(smagHandle_t smag_, unsigned int smag_mask_, const char* name, EJournalLevel default_level)
00036   : Journal(name, default_level), smag(smag_), smag_mask(smag_mask_)
00037   { }
00038 
00041   ~SmagJournal() { }
00042 
00043 protected:
00044   virtual void PrintImpl(const char* str) {
00045         smagStdOutputPrintX(smag, smag_mask, str, 0);
00046   }
00047 
00048   virtual void PrintfImpl(const char* pformat, va_list ap);
00049 
00050   virtual void FlushBufferImpl() {
00051         smagStdOutputFlush(smag, SMAG_ALLMASK);
00052         }
00053 
00054 private:
00055         smagHandle_t smag;
00056         unsigned int smag_mask;
00064   SmagJournal();
00065   SmagJournal(const SmagJournal&);
00066   void operator=(const SmagJournal&);
00067 };
00068 
00069 #endif // __SMAGJOURNAL_HPP__

Generated on Fri May 16 16:17:38 2008 for GAMSlinks by  doxygen 1.4.7