Refactoring: Place m_variables inside Collections

This commit is contained in:
Felipe Zimmerle
2015-10-29 12:39:09 -03:00
parent 787be98122
commit b6ae0585cd
13 changed files with 253 additions and 261 deletions

View File

@@ -61,7 +61,8 @@ bool Capture::evaluate(Rule *rule, Assay *assay) {
int i = 0;
while (match->empty() == false) {
assay->setCollection("TX", std::to_string(i), match->back());
assay->m_collections.storeOrUpdateFirst("TX",
std::to_string(i), match->back());
match->pop_back();
i++;
}

View File

@@ -121,7 +121,7 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
try {
std::string *resolvedValue =
assay->m_variables.resolveFirst(collectionName,
assay->m_collections.resolveFirst(collectionName,
variableNameExpanded);
if (resolvedValue == NULL) {
value = 0;
@@ -146,7 +146,8 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
assay->debug(8, "Saving variable: " + collectionName + ":" + \
variableNameExpanded + " with value: " + targetValue);
#endif
assay->setCollection(collectionName, variableNameExpanded, targetValue);
assay->m_collections.storeOrUpdateFirst(collectionName,
variableNameExpanded, targetValue);
return true;
}