diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-03-17 11:48:54 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-03-17 11:48:54 -0700 |
commit | eb9f5718d412022015bb65eb08c30785c79e79e6 (patch) | |
tree | be0b6a9de27965e39c44c5c8a88adf9caa13abf8 /src/cnode/cnode.hpp | |
parent | cda3f423c311fd30e8cc24e2de67d99baf352b2a (diff) | |
download | vyatta-cfg-eb9f5718d412022015bb65eb08c30785c79e79e6.tar.gz vyatta-cfg-eb9f5718d412022015bb65eb08c30785c79e79e6.zip |
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%.
Diffstat (limited to 'src/cnode/cnode.hpp')
-rw-r--r-- | src/cnode/cnode.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
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<string>& 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<string>& 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<std::string>& getValues() const { return _values; } - const std::string& getComment() const { return _comment; } - const std::vector<CfgNode *>& getChildNodes() const { return _child_nodes; } + const string& getName() const { return _name; } + const string& getValue() const { return _value; } + const vector<string>& getValues() const { return _values; } + const string& getComment() const { return _comment; } + const vector<CfgNode *>& 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<std::string> _values; - std::string _comment; - std::vector<CfgNode *> _child_nodes; + string _name; + string _value; + vector<string> _values; + string _comment; + vector<CfgNode *> _child_nodes; }; } // namespace cnode |