ESyS-Particle  4.0.1
RingBuffer.h
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __RINGBUFFER_H
14 #define __RINGBUFFER_H
15 
16 // --- STL includes ---
17 #include <vector>
18 using std::vector;
19 
23 template <typename T>
25 {
26  private:
27  vector<T> m_buffer;
28  int m_idx;
29  int m_size;
30 
31  public:
32  RingBuffer(int);
33 
34  T& operator[](int);
35  T operator[] (int) const;
36  void insert(const T&);
37  inline int size() const {return m_size;};
38 };
39 
40 #include "Foundation/RingBuffer.hpp"
41 
42 #endif // __RINGBUFFER_H