LTI-Lib latest version v1.9 - last update 10 Apr 2010

ltiIoObject.h

00001 /*
00002  * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
00003  * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany
00004  *
00005  * This file is part of the LTI-Computer Vision Library (LTI-Lib)
00006  *
00007  * The LTI-Lib is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License (LGPL)
00009  * as published by the Free Software Foundation; either version 2.1 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * The LTI-Lib is distributed in the hope that it will be
00013  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00014  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with the LTI-Lib; see the file LICENSE.  If
00019  * not, write to the Free Software Foundation, Inc., 59 Temple Place -
00020  * Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00023 
00024 /*----------------------------------------------------------------
00025  * project ....: LTI Digital Image/Signal Processing Library
00026  * file .......: ltiIoObject.h
00027  * authors ....: Benjamin Winkler
00028  * organization: LTI, RWTH Aachen
00029  * creation ...: 14.12.01
00030  * revisions ..: $Id: ltiIoObject.h,v 1.7 2007/03/02 23:48:32 alvarado Exp $
00031  */
00032 
00033 #ifndef _LTI_IO_OBJECT_H_
00034 #define _LTI_IO_OBJECT_H_
00035 
00036 #include "ltiObject.h"
00037 #include "ltiIoHandler.h"
00038 
00039 namespace lti {
00040 
00041   /**
00042    * basic input/output class for data objects
00043    *
00044    * @ingroup gStorable
00045    */
00046   class ioObject : public object {
00047   public:
00048 
00049     /**
00050      * default constructor
00051      */
00052     ioObject();
00053 
00054     /**
00055      * copy constructor
00056      * @param other the object to be copied
00057      */
00058     ioObject(const ioObject& other);
00059 
00060     /**
00061      * destructor
00062      */
00063     virtual ~ioObject();
00064 
00065     /**
00066      * copy data of "other" ioObject.
00067      * Please note that the status string will _NOT_ be copied!
00068      */
00069     ioObject& copy(const ioObject& other);
00070 
00071     /**
00072      * assigment operator (alias for copy(other)).
00073      * @param other the ioObject to be copied
00074      * @return a reference to the actual ioObject
00075      */
00076     ioObject& operator=(const ioObject& other);
00077 
00078     /**
00079      * returns name of this type
00080      */
00081     const char* getTypeName() const;
00082 
00083     /**
00084      * write the parameters in the given ioHandler
00085      * @param handler the ioHandler to be used
00086      * @param complete if true (the default) the enclosing begin/end will
00087      *        be also written, otherwise only the data block will be written.
00088      * @return true if write was successful
00089      */
00090     virtual bool write(ioHandler& , const bool =true) const {
00091       return true;
00092     };
00093 
00094     /**
00095      * read the parameters from the given ioHandler
00096      * @param handler the ioHandler to be used
00097      * @param complete if true (the default) the enclosing begin/end will
00098      *        be also written, otherwise only the data block will be written.
00099      * @return true if write was successful
00100      */
00101     virtual bool read(ioHandler& ,const bool =true) {
00102       return true;
00103     };
00104 
00105 #   ifdef _LTI_MSC_6
00106     /**
00107      * this function is required by MSVC only, as a workaround for a
00108      * very awful bug, which exists since MSVC V.4.0, and still by
00109      * V.6.0 with all bugfixes (so called "service packs") remains
00110      * there...  This method is public due to another bug!, so please
00111      * NEVER EVER call this method directly
00112      */
00113     bool readMS(ioHandler& handler,const bool complete=true) {
00114       return true;
00115     };
00116 
00117     /**
00118      * this function is required by MSVC only, as a workaround for a
00119      * very awful bug, which exists since MSVC V.4.0, and still by
00120      * V.6.0 with all bugfixes (so called "service packs") remains
00121      * there...  This method is public due to another bug!, so please
00122      * NEVER EVER call this method directly
00123      */
00124     bool writeMS(ioHandler& handler,const bool complete=true) const {
00125       return true;
00126     };
00127 #   endif
00128   };
00129 
00130 
00131   /**
00132    * write
00133    *
00134    * @ingroup gStorable
00135    */
00136   bool write(ioHandler& handler, const ioObject& p, const bool complete=true);
00137 
00138   /**
00139    * read
00140    *
00141    * @ingroup gStorable
00142    */
00143   bool read(ioHandler& handler, ioObject& p, const bool complete=true);
00144 }
00145 
00146 
00147 #endif

Generated on Sat Apr 10 15:25:40 2010 for LTI-Lib by Doxygen 1.6.1