OpenWalnut 1.2.5
|
00001 //--------------------------------------------------------------------------- 00002 // 00003 // Project: OpenWalnut ( http://www.openwalnut.org ) 00004 // 00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS 00006 // For more information see http://www.openwalnut.org/copying 00007 // 00008 // This file is part of OpenWalnut. 00009 // 00010 // OpenWalnut is free software: you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as published by 00012 // the Free Software Foundation, either version 3 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // OpenWalnut is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public License 00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>. 00022 // 00023 //--------------------------------------------------------------------------- 00024 00025 #ifndef WDATAMODULE_H 00026 #define WDATAMODULE_H 00027 00028 #include <boost/shared_ptr.hpp> 00029 00030 #include "WModule.h" 00031 00032 /** 00033 * Base for all data loader modules. This currently is only a prototype to move WMData out of the core. Later, it will provide a whole interface 00034 * to handle arbitrary data/multi-file data and other complex things. 00035 */ 00036 class WDataModule: public WModule 00037 { 00038 public: 00039 00040 /** 00041 * Convenience typedef for a boost::shared_ptr< WDataModule >. 00042 */ 00043 typedef boost::shared_ptr< WDataModule > SPtr; 00044 00045 /** 00046 * Convenience typedef for a boost::shared_ptr< const WDataModule >. 00047 */ 00048 typedef boost::shared_ptr< const WDataModule > ConstSPtr; 00049 00050 /** 00051 * Default constructor. 00052 */ 00053 WDataModule(); 00054 00055 /** 00056 * Destructor. 00057 */ 00058 virtual ~WDataModule(); 00059 00060 /** 00061 * Gets the type of the module. This is useful for FAST differentiation between several modules like standard modules and data 00062 * modules which play a special role in OpenWalnut/Kernel. 00063 * 00064 * \return the Type. If you do not overwrite this method, it will return MODULE_ARBITRARY. 00065 */ 00066 virtual MODULE_TYPE getType() const; 00067 00068 /** 00069 * Getter for the dataset. 00070 * 00071 * \return the dataset encapsulated by this module. 00072 */ 00073 virtual boost::shared_ptr< WDataSet > getDataSet() = 0; 00074 00075 /** 00076 * Sets the filename of the file to load. If this method is called multiple times it has no effect. It has to be called right after 00077 * construction BEFORE running the data module. 00078 * 00079 * \note The reason for using this method to set the filename instead of a property is, that a property gets set AFTER ready(), but this (and 00080 * only this module) needs it before ready got called. 00081 * 00082 * \param fname the name of the file 00083 */ 00084 virtual void setFilename( boost::filesystem::path fname ) = 0; 00085 00086 /** 00087 * Gets the path of the file that has been loaded. It always is the value which has been set during the FIRST call of setFilename. 00088 * 00089 * \return the path of the file that has been loaded. 00090 */ 00091 virtual boost::filesystem::path getFilename() const = 0; 00092 00093 protected: 00094 00095 private: 00096 }; 00097 00098 #endif // WDATAMODULE_H 00099