1 #include "parameter_enum.h"
3 #include "parameter_impl.h"
4 #include "logger_wrapper.h"
6 #if !defined(LOGGER_PROCESS_VSD) && !defined(LOGGER_PROCESS_ADM) && !defined(LOGGER_PROCESS_SNM)
7 #define LOGGER_PROCESS_VSD
10 #ifdef LOGGER_PROCESS_SNM
11 LOG_CATEGORY_TAG param_cat = LOG_CAT_SNMPAGENT_PARAMETER;
12 #elif LOGGER_PROCESS_ADM
13 LOG_CATEGORY_TAG param_cat = LOG_CAT_L7VSADM_PARAMETER;
15 LOG_CATEGORY_TAG param_cat = LOG_CAT_L7VSD_PARAMETER;
19 * Constructor of Parameter class
21 l7vs::Parameter::Parameter()
23 if( !ParameterImpl::getInstance().init() ){
24 LOGGER_PUT_LOG_FATAL( param_cat, 1, "Parameter initialize failure" );
26 case LOG_CAT_L7VSADM_PARAMETER:
29 // throw 1; //don't throw exception at singleton constructor...
36 * Destructor of Parameter class
38 l7vs::Parameter::~Parameter()
44 * @param[in] comp section TAG
45 * @return true = success read file / false = failure read file
48 l7vs::Parameter::rereadFile(PARAMETER_COMPONENT_TAG comp)
50 return ParameterImpl::getInstance().rereadFile(comp);
54 * check whether integer data exists.
55 * @param[in] comp section TAG
56 * @param[in] key key string
57 * @return true = exist setting value / false = non exist setting value
60 l7vs::Parameter::isIntExist(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
62 return ParameterImpl::getInstance().isIntExist(comp, key);
66 * check whether character data exists.
67 * @param[in] comp section TAG
68 * @param[in] key key string
69 * @return true = exist setting value / false = non exist setting value
72 l7vs::Parameter::isStringExist(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
74 return ParameterImpl::getInstance().isStringExist(comp, key);
79 * @param[in] comp section TAG
80 * @param[in] key key string
84 l7vs::Parameter::getIntValue(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
86 return ParameterImpl::getInstance().getIntValue(comp, key);
91 * @param[in] comp section TAG
92 * @param[in] key key string
96 l7vs::Parameter::getStringValue(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
98 return ParameterImpl::getInstance().getStringValue(comp, key);
102 * set-parameter function pointer relates component-tag
103 * @param[in] comp section TAG
104 * @param[in] p_func function pointer
107 l7vs::Parameter::registerFunctionPointer(const PARAMETER_COMPONENT_TAG comp, void(*p_func)())
109 ParameterImpl::getInstance().registerFunctionPointer(comp, p_func);