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 cvrStatusMonitor.h 00044 * Contains the parent class for all status monitors, which are 00045 * objects that control what to do with error reports in functors, 00046 * classifiers, viewers and ioHandlers. 00047 * \author Pablo Alvarado 00048 * \date 30.07.2004 00049 * 00050 * $Id: cvrStatusMonitor.h,v 1.4 2007/05/04 23:57:04 alvarado Exp $ 00051 */ 00052 00053 #ifndef _CVR_STATUS_MONITOR 00054 #define _CVR_STATUS_MONITOR 00055 00056 #include "cvrObject.h" 00057 00058 namespace cvr { 00059 /** 00060 * Class statusMonitor 00061 * 00062 * Status monitors are objects that control what to do when an error is 00063 * reported: should it just be ignored? should it throw and exception? 00064 * should it be streamed out to std::cerr? 00065 * 00066 * You can call the global function cvr::setStatusMonitor() to set 00067 * the object for the whole library. 00068 * 00069 * This is an abstract class. 00070 */ 00071 class statusMonitor : public object { 00072 public: 00073 /** 00074 * Default constructor 00075 */ 00076 statusMonitor(); 00077 00078 /** 00079 * Destructor 00080 */ 00081 virtual ~statusMonitor(); 00082 00083 /** 00084 * Return the name of this class 00085 */ 00086 virtual const std::string& name() const = 0; 00087 00088 /** 00089 * Return a static instance of the current object type, which is not 00090 * clonable since it has a singleton pattern. 00091 */ 00092 virtual statusMonitor* clone() const = 0; 00093 00094 /** 00095 * Return a static instance of the current object type 00096 */ 00097 virtual statusMonitor* newInstance() const = 0; 00098 00099 /** 00100 * Set a status string. 00101 * 00102 * @param id of the reporting class. Usually you give here the output 00103 * of name(). 00104 * @param msg the const string to be reported. 00105 */ 00106 virtual void set(const std::string& id,const char* msg) = 0; 00107 00108 /** 00109 * Set a status string. 00110 * 00111 * @param id of the reporting class. Usually you give here the output 00112 * of name(). 00113 * @param msg the const string to be reported. 00114 */ 00115 virtual void set(const std::string& id,const std::string& msg) = 0; 00116 }; 00117 00118 } 00119 00120 #endif