Alida-C++ 0.5
|
00001 /* 00002 * This file is part of Alida-C++ library for 00003 * 00004 * Automatic Logging of Process Information in Data Analysis. 00005 * 00006 * Copyright (C) 2012 - @YEAR@ 00007 * 00008 * This program is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 * 00021 * Fore more information on Alida, visit 00022 * 00023 * http://www.informatik.uni-halle.de/alida/ 00024 * 00025 */ 00026 00027 /* 00028 * Most recent change(s): 00029 * 00030 * $Rev: 59 $ 00031 * $Date: 2012-03-06 11:59:25 +0100 (Di, 06 Mrz 2012) $ 00032 * $Author: moeller $ 00033 * 00034 */ 00035 00036 #ifndef IOM_H_INCLUDED 00037 #define IOM_H_INCLUDED 00038 00039 #include <map> 00040 #include <string> 00041 00042 #include "dataio/provider/provider.h" 00043 00048 #define REGISTER_PROVIDER(PROVIDER_CLASS,TYPE,PROVIDER_TYPE) \ 00049 Provider* PROVIDER_CLASS ## TYPE ## _myProvider = \ 00050 IOManager ## PROVIDER_TYPE::Instance().registerProvider(typeid( new TYPE()).name(), new PROVIDER_CLASS()); 00051 00055 /* @{ */ 00056 /* @} */ 00057 00058 namespace Alida { 00059 00060 class IOManager 00061 { 00062 public: 00063 00064 virtual ~IOManager() {}; 00065 00066 // virtual Provider* clone() const = 0; 00067 00068 // virtual void* parseInput(std::string, std::string) const = 0; 00069 00070 // void* readData(std::string, std::string); 00071 00072 // static Provider* getProviderObject(string type); 00073 00074 void printRegistrationTable(); 00075 00076 virtual Provider* registerProvider(std::string type, Provider *p); 00077 00078 protected: 00079 00080 // objects of this class should never be generated! 00081 IOManager() {}; 00082 00083 std::map<std::string, Provider*>* registrationTable; 00084 00085 // public: 00086 // 00087 // static std::map<std::string, std::string> *provider; 00088 // 00089 // public: 00090 // 00091 // static void init(); 00092 // 00093 // static void registerProvider(std::string type, std::string classname); 00094 // 00095 // static void* readObject(std::string input, std::string type); 00096 }; 00097 00098 } 00099 00100 #endif /* IOM_H_INCLUDED */