Alida-C++ 0.5

operator/aldOperatorManager.h

Go to the documentation of this file.
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: 10 $
00031  * $Date: 2012/03/06 20:50:22 $
00032  * $Author: posch $
00033  *
00034  */
00035 
00036 #ifndef OPERATOR_MANAGER_H_INCLUDED
00037 #define OPERATOR_MANAGER_H_INCLUDED
00038 
00039 #include <map>
00040 #include <string>
00041 #include <typeinfo>
00042 
00043 #include "../external/loki-0.1.7/include/loki/Singleton.h"
00044 
00045 #include "operator/aldOperator.h"
00046 #include "operator/aldOpParameterDescriptor.h"
00047 
00052 #define REGISTER_OPERATOR(OPERATOR_CLASS) \
00053     ALDOperator* OPERATOR_CLASS ## _myOperator = \
00054         ALDOperatorManager::Instance().registerOperator(#OPERATOR_CLASS, new OPERATOR_CLASS());
00055 
00056 #define LOKI_OBJECT_LEVEL_THREADING
00057 
00058 namespace Alida {
00059 
00060 class _ALDOperatorManager
00061 {
00062 protected:
00063 
00064     _ALDOperatorManager();
00065 
00066     virtual ~_ALDOperatorManager() {};
00067 
00068     friend class Loki::CreateUsingNew<Alida::_ALDOperatorManager>;
00069 
00070     std::map<std::string, ALDOperator*>* operatorHash;
00071 
00072 public:
00073   
00074   ALDOperator* registerOperator(std::string name, ALDOperator *op);
00075 
00076   void printOperatorHash();
00077 
00078   ALDOperator* getOperator(std::string);
00079 
00080  protected:
00081 
00082 
00083 public:
00084 
00085 
00086 //  friend class Loki::SingletonHolder<T, Loki::CreateUsingNew,
00087 //      Loki::DefaultLifetime, Loki::SingleThreaded>;
00088 /*
00089   <,
00090   Loki::CreateUsingNew,
00091   Loki::DefaultLifetime,
00092   Loki::SingleThreaded>;
00093 */
00094 };
00095 
00096 }
00097 
00098 typedef Loki::SingletonHolder<Alida::_ALDOperatorManager,
00099   Loki::CreateUsingNew,
00100   Loki::DefaultLifetime,
00101   Loki::SingleThreaded
00102 > ALDOperatorManager;
00103 
00104 #endif /* OPERATOR_MANAGER_H_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines