--- /dev/null
+#include "MemoryContext.h"
+
+namespace enco
+{
+
+void MemoryContext::base(const coco::Bag *bag, const std::string &exp) { _base[bag] = exp; }
+void MemoryContext::size(const coco::Bag *bag, const std::string &exp) { _size[bag] = exp; }
+
+} // namespace enco
--- /dev/null
+#ifndef __ENCO_CPP_GEN_MEMORY_CONTEXT_H__
+#define __ENCO_CPP_GEN_MEMORY_CONTEXT_H__
+
+#include <coco/IR/Bag.h>
+
+#include <string>
+#include <map>
+
+namespace enco
+{
+
+/**
+ * @brief Record C/C++ expression that denotes the base and size of memory region
+ * dedicated to each bag
+ */
+class MemoryContext
+{
+public:
+ void base(const coco::Bag *bag, const std::string &exp);
+ void size(const coco::Bag *bag, const std::string &exp);
+
+public:
+ const std::string &base(const coco::Bag *bag) const { return _base.at(bag); }
+ const std::string &size(const coco::Bag *bag) const { return _size.at(bag); }
+
+private:
+ std::map<const coco::Bag *, std::string> _base;
+ std::map<const coco::Bag *, std::string> _size;
+};
+
+} // namespace enco
+
+#endif // __ENCO_CPP_GEN_MEMORY_CONTEXT_H__