CVR-Lib last update 20 Sep 2009

cvrProgressReporter.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1998 - 2005
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   cvrProgressReporter.h
00044  *         Contains the class cvr::progressReporter. All classes that
00045  *         want to report progress via a progressInfo object should
00046  *         derive from this class.
00047  * \author Peter Doerfler
00048  * \date   30.03.2005
00049  *
00050  * $Id: cvrProgressReporter.h,v 1.4 2007/10/07 04:20:59 alvarado Exp $
00051  */
00052 
00053 #ifndef _CVR_PROGRESS_REPORTER_H_
00054 #define _CVR_PROGRESS_REPORTER_H_
00055 
00056 
00057 namespace cvr  {
00058   class progressInfo;
00059 
00060   /**
00061    * Interface for all objects that provide progressInfo interface.
00062    *
00063    * \ingroup gInterfaces
00064    */
00065   class progressReporter {
00066   public:
00067 
00068     /**
00069      * Default destructor
00070      */
00071     progressReporter();
00072 
00073     /**
00074      * Copy destructor
00075      */
00076     progressReporter(const progressReporter& other);
00077 
00078     /**
00079      * Destructor
00080      */
00081     virtual ~progressReporter();
00082 
00083     /**
00084      * Copy the \a other progressReporter
00085      */
00086     progressReporter& copy(const progressReporter& other);
00087 
00088     /**
00089      * Copy the \a other progressReporter
00090      */
00091     progressReporter& operator=(const progressReporter& other);
00092 
00093     /**
00094      * Return a pointer to a clone of this progressReporter
00095      */
00096     progressReporter* clone() const;
00097 
00098     /**
00099      * Return a pointer to a new instance of this progressReporter
00100      */
00101     progressReporter* newInstance() const;
00102 
00103     /**
00104      * Set the progressInfo %object to be used.
00105      *
00106      * A clone of the given %object will be generated.
00107      */
00108     void setProgressObject(const progressInfo& progress);
00109 
00110     /**
00111      * Remove the active progressInfo %object.
00112      */
00113     void removeProgressObject();
00114 
00115     /**
00116      * Return true if a valid progressInfo %object has already been set.
00117      */
00118     bool haveValidProgressObject() const;
00119 
00120     /**
00121      * Return true if a valid progressInfo %object has already been set, and if
00122      * its detail level is greater or equal the given value.
00123      */
00124     bool haveValidProgressObject(const int detailLevel) const;
00125 
00126     /**
00127      * Get a read-only reference to the progressInfo %object
00128      */
00129     const progressInfo& getProgressObject() const;
00130 
00131     /**
00132      * Get a modifiable reference to the progressInfo %object
00133      */
00134     progressInfo& getProgressObject();
00135 
00136   protected:
00137 
00138     /**
00139      * The current progressInfo %object.
00140      */
00141     progressInfo* progressObject_;
00142   };
00143 
00144 
00145 } //namespace cvr
00146 
00147 #endif

Generated on Sun Sep 20 22:08:00 2009 for CVR-Lib by Doxygen 1.5.8