EvolvingObjects
eoOStreamMonitor.h
00001 /*
00002 
00003 (c) Marc Schoenauer, Maarten Keijzer and GeNeura Team, 2000
00004 (c) Thales group, 2010
00005 
00006     This library is free software; you can redistribute it and/or modify it under
00007     the terms of the GNU Lesser General Public License as published by the Free
00008     Software Foundation; version 2 of the license.
00009 
00010     This library is distributed in the hope that it will be useful, but WITHOUT ANY
00011     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
00012     PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public License along
00015     with this library; if not, write to the Free Software Foundation, Inc., 59
00016     Temple Place, Suite 330, Boston, MA 02111-1307 USA
00017 
00018 Contact: http://eodev.sourceforge.net
00019 
00020 Authors:
00021      todos@geneura.ugr.es
00022      Marc.Schoenauer@polytechnique.fr
00023      mkeijzer@dhi.dk
00024          Johann Dréo <johann.dreo@thalesgroup.com>
00025 */
00026 
00027 #ifndef _eoOStreamMonitor_h_
00028 #define _eoOStreamMonitor_h_
00029 
00030 #include <string>
00031 #include <iostream>
00032 
00033 #include <utils/eoMonitor.h>
00034 #include <utils/eoLogger.h>
00035 #include <eoObject.h>
00036 
00044 class eoOStreamMonitor : public eoMonitor
00045 {
00046 public :
00047     /* FIXME remove in next release
00048     eoOStreamMonitor( std::ostream & _out, bool _verbose=true, std::string _delim = "\t", unsigned int _width=20, char _fill=' ' ) :
00049         out(_out), delim(_delim), width(_width), fill(_fill), firsttime(true)
00050     {
00051 #ifndef DEPRECATED_MESSAGES
00052         eo::log << eo::warnings << "WARNING: the use of the verbose parameter in eoOStreamMonitor constructor is deprecated and will be removed in the next release" << std::endl;
00053 #pragma message "WARNING: the use of the verbose parameter in eoOStreamMonitor constructor is deprecated and will be removed in the next release"
00054 #endif // !DEPRECATED_MESSAGES
00055 
00056     }
00057     */
00058 
00059     eoOStreamMonitor( std::ostream & _out, std::string _delim = "\t", unsigned int _width=20, char _fill=' ' ) :
00060         out(_out), delim(_delim), width(_width), fill(_fill), firsttime(true)
00061     {}
00062 
00063     eoMonitor& operator()(void);
00064 
00065     virtual std::string className(void) const { return "eoOStreamMonitor"; }
00066 
00067 private :
00068     std::ostream & out;
00069     std::string delim;
00070     unsigned int width;
00071     char fill;
00072     bool firsttime;
00073 };
00074 
00075 #endif // _eoOStreamMonitor_h_
 All Classes Namespaces Files Functions Variables Typedefs Friends