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/cstore/ctemplate.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/cstore/ctemplate.hpp')
-rw-r--r-- | src/cstore/ctemplate.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cstore/ctemplate.hpp b/src/cstore/ctemplate.hpp index 1915273..e970a5d 100644 --- a/src/cstore/ctemplate.hpp +++ b/src/cstore/ctemplate.hpp @@ -28,10 +28,10 @@ using namespace std; class Ctemplate { public: - Ctemplate(tr1::shared_ptr<vtw_def> def) : _def(def) {}; + Ctemplate(tr1::shared_ptr<vtw_def> def) : _def(def), _is_value(false) {}; ~Ctemplate() {}; - bool isValue() const { return _def->is_value; }; + bool isValue() const { return _is_value; }; bool isMulti() const { return _def->multi; }; bool isTag() const { return _def->tag; }; bool isTagNode() const { return (isTag() && !isValue()); }; @@ -90,7 +90,7 @@ public: unsigned int getTagLimit() const { return _def->def_tag; }; unsigned int getMultiLimit() const { return _def->def_multi; }; - void setIsValue(bool is_val) { _def->is_value = is_val; }; + void setIsValue(bool is_val) { _is_value = is_val; }; const vtw_def *getDef() const { /* XXX this is a hack for code that has not been converted and is still @@ -118,6 +118,9 @@ private: * handled properly. */ tr1::shared_ptr<vtw_def> _def; + bool _is_value; /* whether the last path component is a "value". set by + * the cstore in get_parsed_tmpl(). + */ }; } // end namespace cstore |