3 * @brief ultramonkey-l7 parameter class.
5 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
6 * Copyright (C) 2009 NTT COMWARE Corporation.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 **********************************************************************/
30 #include "parameter_enum.h"
31 #include "error_code.h"
33 #ifndef PARAMETER_FILE
34 #define PARAMETER_FILE "/etc/l7vs/l7vs.cf"
35 #endif //PARAMETER_FILE
42 //! @brief configure file controller
43 //! @brief set key to get value.
47 Parameter(); //!< default constructor
48 ~Parameter(); //!< default destructor
50 //! initialize(file designation)
51 //! @param[in] component tag
52 //! @param[in] file name
53 //! @return true success
54 //! @return false fail
55 bool init(const PARAMETER_COMPONENT_TAG, const std::string &);
57 //! reload file function
58 //! @param[in] parameter component tag
59 //! @param[in] configuration filename
60 //! default:PARAMETER_FILE
61 //! @return true success file read
62 //! @return false failure file read
63 bool read_file(const PARAMETER_COMPONENT_TAG,
64 const std::string& = PARAMETER_FILE);
66 //! parameter int value getter
67 //! @param[in] parameter category
68 //! @param[in] parameter key
69 //! @param[out] error code
70 //! @param[in] configuration filename
71 //! default:PARAMETER_FILE
73 int get_int(const PARAMETER_COMPONENT_TAG,
76 const std::string& = PARAMETER_FILE);
78 //! parameter string value getter
79 //! @param[in] parameter category
80 //! @param[in] parameter key
81 //! @param[out] error code
82 //! @param[in] configuration filename
83 //! default:PARAMETER_FILE
84 //! @return string value
85 std::string get_string(const PARAMETER_COMPONENT_TAG,
88 const std::string& = PARAMETER_FILE);
90 //! parameter multistring value getter
91 //! @param[in] parameter category
92 //! @param[in] parameter key
93 //! @param[inout] string vector
94 //! @param[out] error code
95 //! @param[in] configuration filename
96 //! default:PARAMETER_FILE
97 //! @return string value
98 void get_multistring(const PARAMETER_COMPONENT_TAG,
100 std::vector<std::string>&,
102 const std::string& = PARAMETER_FILE);