00001 /* 00002 * (c) Copyright 2008 Philipp Skadorov (philipp_s@users.sourceforge.net) 00003 * 00004 * This file is part of FREESECS. 00005 * 00006 * FREESECS is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * FREESECS is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with FREESECS, see COPYING. 00018 * If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 #ifndef _HSMS_FACTORY_H 00021 #define _HSMS_FACTORY_H 00022 00023 #include <vector> 00024 #include <string> 00025 #include "shared_ptr.h" 00026 00027 namespace freesecs 00028 { 00029 class hsms_active_cnx_t; 00030 class hsms_passive_cnx_t; 00031 00040 class hsms_factory_t 00041 { 00042 public: 00043 enum 00044 { 00045 NO_ERR = 0, 00046 INVALID_FILENAME, 00047 EMPTY_CONFIG, 00048 PARSE_ERROR, 00049 }; 00050 00051 typedef shared_ptr_t<hsms_active_cnx_t> active_cnx_ptr_t; 00052 typedef shared_ptr_t<hsms_passive_cnx_t> passive_cnx_ptr_t; 00053 00054 int parse_config(const char *file_name); 00055 void clear(); 00056 00057 public: 00058 typedef std::vector<active_cnx_ptr_t> active_cnx_container_t; 00059 typedef std::vector<passive_cnx_ptr_t> passive_cnx_container_t; 00060 typedef std::vector<std::string> error_container_t; 00061 00062 active_cnx_container_t active; 00063 passive_cnx_container_t passive; 00064 error_container_t errors; 00065 }; 00066 }//namespace 00067 #endif/*_HSMS_FACTORY_H*/