00001 // sampalib.org ESL library and tools 00002 // Copyright (C) 2007 Thierry Grellier 00003 // 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License version 2 as 00006 // published by the Free Software Foundation. 00007 // 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along 00014 // with this program; if not, write to the Free Software Foundation, Inc., 00015 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 // 00017 // contact: www.sampalib.org 00018 00019 #ifndef SAMPA_COMPONENT_INITIALIZATION_H 00020 #define SAMPA_COMPONENT_INITIALIZATION_H 00021 00022 #include "sampa/component/protocol.h" 00023 #include "sampa/core/global_function.h" 00024 00025 namespace Sampa { 00026 void protocol_initialize_statics(Transaction::FactoryBase* (*create_factory)()); 00027 00028 template<class TopLevel> 00029 bool protocol_initialize(int argc, char** argv, TopLevel*& top_level, Transaction::FactoryBase* (*create_factory)() = 0) { 00030 if (!initialize(argc, argv, top_level)) return false; 00031 if (top_level == 0) protocol_initialize_statics(create_factory); 00032 return true; 00033 } 00034 00035 } 00036 00037 #endif
1.5.3