diff options
author | Josh Blum | 2013-04-15 23:43:33 -0700 |
---|---|---|
committer | Josh Blum | 2013-04-15 23:43:33 -0700 |
commit | d58659dd2d6d2c7c9411a689254ae0ad8b2c0764 (patch) | |
tree | 1fe754947fddcd557cb009ff3f98adeae0f8818a /include/gras | |
parent | c04e9a6d74f1c7b66a7efd816f857a6a9029c192 (diff) | |
download | sandhi-d58659dd2d6d2c7c9411a689254ae0ad8b2c0764.tar.gz sandhi-d58659dd2d6d2c7c9411a689254ae0ad8b2c0764.tar.bz2 sandhi-d58659dd2d6d2c7c9411a689254ae0ad8b2c0764.zip |
gras: added vec call to work buffer
Diffstat (limited to 'include/gras')
-rw-r--r-- | include/gras/detail/work_buffer.hpp | 19 | ||||
-rw-r--r-- | include/gras/work_buffer.hpp | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/gras/detail/work_buffer.hpp b/include/gras/detail/work_buffer.hpp index 851bbf9..ec7cbea 100644 --- a/include/gras/detail/work_buffer.hpp +++ b/include/gras/detail/work_buffer.hpp @@ -60,6 +60,25 @@ inline size_t &WorkBufferArray<PtrType>::max(void) return _max; } +template <typename PtrType> +inline const std::vector<PtrType> &WorkBufferArray<PtrType>::vec(void) const +{ + return _vec; +} + +template <typename PtrType> +inline std::vector<PtrType> &WorkBufferArray<PtrType>::vec(void) +{ + return _vec; +} + +template <typename PtrType> +inline void WorkBufferArray<PtrType>::resize(const size_t size) +{ + _vec.resize(size); + std::vector<WorkBuffer<PtrType> >::resize(size); +} + } //namespace gras #endif /*INCLUDED_GRAS_DETAIL_WORK_BUFFER_HPP*/ diff --git a/include/gras/work_buffer.hpp b/include/gras/work_buffer.hpp index 0900ed7..fa38314 100644 --- a/include/gras/work_buffer.hpp +++ b/include/gras/work_buffer.hpp @@ -50,9 +50,19 @@ public: //! Get a reference to the max items size_t &max(void); + //! Get a vector of just the work pointers + const std::vector<PtrType> &vec(void) const; + + //! Get a reference to the work pointers + std::vector<PtrType> &vec(void); + + //! Resize the work buffer array + void resize(const size_t size); + private: size_t _min; size_t _max; + std::vector<PtrType> _vec; }; } //namespace gras |