last update 20 Sep 2009 |
00001 /* 00002 * Copyright (C) 1998-2004 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * 00006 * This file is part of the Computer Vision and Robotics Library (CVR-Lib) 00007 * 00008 * The CVR-Lib is free software; you can redistribute it and/or 00009 * modify it under the terms of the BSD License. 00010 * 00011 * All rights reserved. 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions are met: 00015 * 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 00019 * 2. Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * 00023 * 3. Neither the name of the authors nor the names of its contributors may be 00024 * used to endorse or promote products derived from this software without 00025 * specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00028 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00031 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00032 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00033 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00034 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00035 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00036 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00037 * POSSIBILITY OF SUCH DAMAGE. 00038 */ 00039 00040 00041 00042 /** 00043 * \file cvrStatusMonitorException.h 00044 * Contains a status monitor that displays the information as soon as 00045 * a setStatusString is called. 00046 * \author Pablo Alvarado 00047 * \date 04.05.2007 00048 * 00049 * $Id: cvrStatusMonitorException.h,v 1.1 2007/05/04 23:57:04 alvarado Exp $ 00050 */ 00051 00052 #include "cvrStatusMonitor.h" 00053 #include <iostream> 00054 00055 namespace cvr { 00056 /** 00057 * Class statusMonitorException 00058 * 00059 * Status monitors are objects that control what to do when an error 00060 * is reported. In this particular case, the error is reported on 00061 * the std::cerr, or, if you want it so, on another std::stream you specify 00062 * 00063 * You can call the global function cvr::setStatusMonitor() to set 00064 * the object for the whole library. 00065 * 00066 * This is an abstract class. 00067 */ 00068 class statusMonitorException : public statusMonitor { 00069 public: 00070 /** 00071 * Default constructor 00072 */ 00073 statusMonitorException(); 00074 00075 /** 00076 * Copy constructor 00077 */ 00078 statusMonitorException(const statusMonitorException& stMonitor); 00079 00080 /** 00081 * Destructor 00082 */ 00083 virtual ~statusMonitorException(); 00084 00085 /** 00086 * Return the name of this class 00087 */ 00088 virtual const std::string& name() const; 00089 00090 /** 00091 * Return a static instance of the current object type, which is not 00092 * clonable since it has a singleton pattern. 00093 */ 00094 virtual statusMonitorException* clone() const; 00095 00096 /** 00097 * Return a static instance of the current object type 00098 */ 00099 virtual statusMonitorException* newInstance() const; 00100 00101 /** 00102 * Set a status string. 00103 * 00104 * @param id of the reporting class. Usually you give here the output 00105 * of name(). 00106 * @param msg the const string to be reported. 00107 */ 00108 virtual void set(const std::string& id,const char* msg); 00109 00110 /** 00111 * Set a status string. 00112 * 00113 * @param id of the reporting class. Usually you give here the output 00114 * of name(). 00115 * @param msg the const string to be reported. 00116 */ 00117 virtual void set(const std::string& id,const std::string& msg) ; 00118 }; 00119 }