This commit adds 'LayerContext' class which maintains a sequence of
'Layer' objects.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
--- /dev/null
+#ifndef __LAYER_CONTEXT_H__
+#define __LAYER_CONTEXT_H__
+
+#include "Layer.h"
+
+#include <vector>
+#include <memory>
+#include <cstdint>
+
+class LayerContext
+{
+public:
+ uint32_t size(void) const;
+
+public:
+ Layer &at(uint32_t n);
+ const Layer &at(uint32_t n) const;
+
+public:
+ LayerContext &append(std::unique_ptr<Layer> &&l);
+
+private:
+ std::vector<std::unique_ptr<Layer>> _layers;
+};
+
+#endif // __LAYER_CONTEXT_H__
--- /dev/null
+#include "LayerContext.h"
+
+uint32_t LayerContext::size(void) const { return _layers.size(); };
+
+Layer &LayerContext::at(uint32_t n) { return *(_layers.at(n)); }
+const Layer &LayerContext::at(uint32_t n) const { return *(_layers.at(n)); }
+
+LayerContext &LayerContext::append(std::unique_ptr<Layer> &&l)
+{
+ _layers.emplace_back(std::move(l));
+}