From eb9f5718d412022015bb65eb08c30785c79e79e6 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 17 Mar 2011 11:48:54 -0700 Subject: add config path abstraction and high-level caching * part of the config backend cleanup/optimization work. * improves the performance of "load" (w/o commit) by ~55% and "show" by ~15%. --- src/cnode/cnode.hpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/cnode/cnode.hpp') diff --git a/src/cnode/cnode.hpp b/src/cnode/cnode.hpp index b7afc36..a684514 100644 --- a/src/cnode/cnode.hpp +++ b/src/cnode/cnode.hpp @@ -27,10 +27,10 @@ using namespace cstore; class CfgNode { public: - CfgNode(vector& path_comps, char *name, char *val, char *comment, + CfgNode(Cpath& path_comps, char *name, char *val, char *comment, int deact, Cstore *cstore, bool tag_if_invalid = false); - CfgNode(Cstore& cstore, std::vector& path_comps, - bool active = false, bool recursive = true); + CfgNode(Cstore& cstore, Cpath& path_comps, bool active = false, + bool recursive = true); ~CfgNode() {}; bool isTag() const { return _is_tag; } @@ -44,11 +44,11 @@ public: bool isEmpty() const { return _is_empty; } bool exists() const { return _exists; } - const std::string& getName() const { return _name; } - const std::string& getValue() const { return _value; } - const std::vector& getValues() const { return _values; } - const std::string& getComment() const { return _comment; } - const std::vector& getChildNodes() const { return _child_nodes; } + const string& getName() const { return _name; } + const string& getValue() const { return _value; } + const vector& getValues() const { return _values; } + const string& getComment() const { return _comment; } + const vector& getChildNodes() const { return _child_nodes; } void addMultiValue(char *val) { _values.push_back(val); } void addChildNode(CfgNode *cnode) { @@ -68,11 +68,11 @@ private: bool _is_invalid; bool _is_empty; bool _exists; - std::string _name; - std::string _value; - std::vector _values; - std::string _comment; - std::vector _child_nodes; + string _name; + string _value; + vector _values; + string _comment; + vector _child_nodes; }; } // namespace cnode -- cgit v1.2.3