Extends the direct access model to other collections

This commit is contained in:
Felipe Zimmerle
2017-01-26 23:13:38 -03:00
committed by Felipe Zimmerle
parent ca24b6bb06
commit f2d149fc5f
157 changed files with 7711 additions and 4959 deletions

View File

@@ -50,7 +50,7 @@ class Collection {
virtual void del(const std::string& key) = 0;
virtual std::string* resolveFirst(const std::string& var) = 0;
virtual std::unique_ptr<std::string> resolveFirst(const std::string& var) = 0;
virtual void resolveSingleMatch(const std::string& var,
std::vector<const Variable *> *l) = 0;
@@ -83,7 +83,7 @@ class Collection {
del(nkey);
}
virtual std::string* resolveFirst(const std::string& var,
virtual std::unique_ptr<std::string> resolveFirst(const std::string& var,
std::string compartment) {
std::string nkey = compartment + "::" + var;
return resolveFirst(nkey);

View File

@@ -56,8 +56,8 @@ class Collections :
bool storeOrUpdateFirst(const std::string &key, const std::string &value);
bool updateFirst(const std::string &key, const std::string &value);
void del(const std::string& key);
std::string* resolveFirst(const std::string& var);
std::string* resolveFirst(const std::string& collectionName,
std::unique_ptr<std::string> resolveFirst(const std::string& var);
std::unique_ptr<std::string> resolveFirst(const std::string& collectionName,
const std::string& var);
void resolveSingleMatch(const std::string& var,

View File

@@ -40,22 +40,28 @@ class Variable {
m_key(key),
m_value(),
m_dynamic_value(false),
m_dynamic_key(false),
m_dynamic(true) { }
Variable(const std::string *key, const std::string *value) :
m_key(key),
m_value(value),
m_dynamic_value(false),
m_dynamic_key(false),
m_dynamic(true) { }
~Variable() {
if (m_dynamic_value) {
delete m_value;
}
if (m_dynamic_key) {
delete m_key;
}
}
const std::string *m_key;
const std::string *m_value;
bool m_dynamic_value;
bool m_dynamic_key;
bool m_dynamic;
std::list<std::unique_ptr<VariableOrigin>> m_orign;
};