diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index f32d233b1..083147867 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -94,6 +94,20 @@ public: void getVector3s(std::vector &vec, size_t size); void getVector4s(std::vector &vec, size_t size); void getQuaternions(std::vector &quat, size_t size); + + ///Return a vector of whatever object is needed + template + std::vector getItems(size_t number_of_items) + { + std::vector items; + items.reserve(number_of_items); + for(size_t i=0; i < number_of_items; ++i) + { + items.push_back(get()); + } + return items; + } + }; }