/******************************************************************************* * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited. * Proprietary and confidential. ******************************************************************************/ #pragma once #include #include #include namespace zilliz { namespace vecwise { namespace server { class ConfigNode; typedef std::vector ConfigNodeArr; class ConfigNode { public: void Combine(const ConfigNode& target); //key/value pair config void SetValue(const std::string &key, const std::string &value); std::string GetValue(const std::string ¶m_key, const std::string &default_val = "") const; bool GetBoolValue(const std::string ¶m_key, bool default_val = false) const; int32_t GetInt32Value(const std::string ¶m_key, int32_t default_val = 0) const; int64_t GetInt64Value(const std::string ¶m_key, int64_t default_val = 0) const; float GetFloatValue(const std::string ¶m_key, float default_val = 0.0) const; double GetDoubleValue(const std::string ¶m_key, double default_val = 0.0) const; const std::map& GetConfig() const; void ClearConfig(); //key/object config void AddChild(const std::string &type_name, const ConfigNode &config); ConfigNode GetChild(const std::string &type_name) const; ConfigNode& GetChild(const std::string &type_name); void GetChildren(ConfigNodeArr &arr) const; const std::map& GetChildren() const; void ClearChildren(); //key/sequence config void AddSequenceItem(const std::string &key, const std::string &item); std::vector GetSequence(const std::string &key) const; const std::map >& GetSequences() const; void ClearSequences(); void PrintAll(const std::string &prefix = "") const; std::string DumpString(const std::string &prefix = "") const; private: std::map config_; std::map children_; std::map > sequences_; }; } } }