Refactoring: Create class Collection to hold collection properties

This commit is contained in:
Felipe Zimmerle
2015-10-29 14:13:39 -03:00
parent b6ae0585cd
commit 061ba0131a
3 changed files with 199 additions and 2 deletions

View File

@@ -29,6 +29,7 @@
#include "modsecurity/transaction/variables.h"
#include "modsecurity/transaction/variable.h"
#include "modsecurity/transaction/collection.h"
#ifndef HEADERS_MODSECURITY_TRANSACTION_COLLECTIONS_H_
#define HEADERS_MODSECURITY_TRANSACTION_COLLECTIONS_H_
@@ -42,11 +43,12 @@ namespace ModSecurity {
namespace transaction {
class Collections :
public std::unordered_map<std::string, transaction::Variables *> {
public std::unordered_map<std::string, Collection *> {
public:
Collections();
~Collections();
void init(const std::string& name, const std::string& key);
void store(std::string key, std::string value);
void storeOrUpdateFirst(const std::string& collectionName,
const std::string& variableName,
@@ -62,7 +64,6 @@ class Collections :
std::list<transaction::Variable *> *l);
std::list<transaction::Variable *> *resolve(const std::string& var);
/**
* This is a special collection to host the transaction variables.
*