|
@@ -291,6 +291,30 @@ class Vector : public Container<std::vector<V>,V>{
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+template <typename V>
|
|
|
+class VectorMany : public Container<std::vector<V>,std::vector<V>>{
|
|
|
+ private:
|
|
|
+
|
|
|
+ void _fill(){
|
|
|
+ for(const V& val: this->value->get_value())
|
|
|
+ this->container->push_back(val);
|
|
|
+ }
|
|
|
+ public:
|
|
|
+ VectorMany(const std::string& name, Value<std::vector<V>>* value)
|
|
|
+ :Container<std::vector<V>,std::vector<V>>(name, value){
|
|
|
+ this->container = new std::vector<V>;
|
|
|
+ }
|
|
|
+
|
|
|
+ GenContainer* clone_as(const std::string& new_name){
|
|
|
+ return new VectorMany<V>(new_name, this->value);
|
|
|
+ }
|
|
|
+
|
|
|
+ void save_as(const std::string& fname, const SaveOption& option = SaveOption::PNG) {
|
|
|
+ std::string type_name = "std::vector<"+fv::util::get_type_name(typeid(V))+">";
|
|
|
+ util::save_as_stl(this->get_container(), type_name, this->get_name(), option);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
template <typename V, typename D>
|
|
|
class _Counter : public Container<std::map<D,int>,V>{
|
|
|
public:
|