2 * @file parameter_impl.h
\r
3 * @brief parameter module implementation class.
\r
5 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
\r
6 * Copyright (C) 2008 NTT COMWARE Corporation.
\r
8 * This program is free software; you can redistribute it and/or
\r
9 * modify it under the terms of the GNU Lesser General Public
\r
10 * License as published by the Free Software Foundation; either
\r
11 * version 2.1 of the License, or (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
16 * Lesser General Public License for more details.
\r
18 * You should have received a copy of the GNU Lesser General Public
\r
19 * License along with this library; if not, write to the Free Software
\r
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
\r
23 **********************************************************************/
\r
25 #ifndef __PARAMETER_IMPL_H__
\r
26 #define __PARAMETER_IMPL_H__
\r
28 #include "parameter_enum.h"
\r
37 std::string section;
\r
39 component(){ section = ""; function = NULL;}
\r
40 component( std::string str, void (*p_func)() ){ section = str; function = p_func;}
\r
41 component& operator=(const component& in_comp){
\r
42 section = in_comp.section;
\r
43 function = in_comp.function;
\r
50 std::string removebrank( const std::string& );
\r
51 bool readParameterFile( const std::string& );
\r
52 bool isNumeric( const std::string& );
\r
54 std::multimap<std::string,std::string> preparse;
\r
56 std::map<PARAMETER_COMPONENT_TAG, component> compTable;
\r
57 std::multimap<std::string, std::string> stringMap;
\r
58 std::multimap<std::string, int> intMap;
\r
62 ParameterImpl( const ParameterImpl& );
\r
63 ParameterImpl& operator=( const ParameterImpl& );
\r
66 static ParameterImpl & getInstance(){
\r
67 static ParameterImpl instance;
\r
71 bool rereadFile( const PARAMETER_COMPONENT_TAG, const std::string& );
\r
73 bool isIntExist( const PARAMETER_COMPONENT_TAG, const std::string& );
\r
74 bool isStringExist( const PARAMETER_COMPONENT_TAG, const std::string& );
\r
75 int getIntValue( const PARAMETER_COMPONENT_TAG, const std::string& );
\r
76 std::string getStringValue( const PARAMETER_COMPONENT_TAG, const std::string& );
\r
77 void getStringMapValue( const PARAMETER_COMPONENT_TAG, const std::string&, std::multimap<std::string, std::string>&);
\r
79 void registerFunctionPointer( const PARAMETER_COMPONENT_TAG, void (*)() );
\r
82 #endif //__PARAMETER_IMPL_H__
\r