2012-06-28 15:43:49 +02:00
|
|
|
#ifndef RINGBUFFER_H
|
|
|
|
#define RINGBUFFER_H
|
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
2012-07-01 13:21:49 +02:00
|
|
|
class I2_BASE_API Ringbuffer
|
2012-06-28 15:43:49 +02:00
|
|
|
{
|
|
|
|
public:
|
2012-07-02 18:40:30 +02:00
|
|
|
Ringbuffer(long slots);
|
2012-06-28 15:43:49 +02:00
|
|
|
|
|
|
|
int GetLength(void) const;
|
|
|
|
void InsertValue(long tv, int num);
|
|
|
|
int GetValues(long span) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
vector<int> m_Slots;
|
2012-07-02 18:40:30 +02:00
|
|
|
vector<int>::size_type m_Offset;
|
2012-06-28 15:43:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* RINGBUFFER_H */
|