From: Gunnar Beutner Date: Mon, 9 Jul 2012 18:11:55 +0000 (+0200) Subject: Renamed Ringbuffer class to RingBuffer X-Git-Tag: v0.0.1~278^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4402a26c3e1006aaf649b46972d911f02ac1b7d6;p=icinga2 Renamed Ringbuffer class to RingBuffer --- diff --git a/base/ringbuffer.cpp b/base/ringbuffer.cpp index 1d91f7ff2..baa432849 100644 --- a/base/ringbuffer.cpp +++ b/base/ringbuffer.cpp @@ -2,16 +2,16 @@ using namespace icinga; -Ringbuffer::Ringbuffer(long slots) +RingBuffer::RingBuffer(long slots) : m_Slots(slots, 0), m_Offset(0) { } -int Ringbuffer::GetLength(void) const +long RingBuffer::GetLength(void) const { return m_Slots.size(); } -void Ringbuffer::InsertValue(long tv, int num) +void RingBuffer::InsertValue(long tv, int num) { vector::size_type offsetTarget = tv % m_Slots.size(); @@ -28,7 +28,7 @@ void Ringbuffer::InsertValue(long tv, int num) m_Slots[m_Offset] += num; } -int Ringbuffer::GetValues(long span) const +int RingBuffer::GetValues(long span) const { if (span > m_Slots.size()) span = m_Slots.size(); diff --git a/base/ringbuffer.h b/base/ringbuffer.h index c4c16bfed..2469fbaa3 100644 --- a/base/ringbuffer.h +++ b/base/ringbuffer.h @@ -4,12 +4,12 @@ namespace icinga { -class I2_BASE_API Ringbuffer +class I2_BASE_API RingBuffer { public: - Ringbuffer(long slots); + RingBuffer(long slots); - int GetLength(void) const; + long GetLength(void) const; void InsertValue(long tv, int num); int GetValues(long span) const; diff --git a/cib/cib.cpp b/cib/cib.cpp index e09c73f8b..f9f76d871 100644 --- a/cib/cib.cpp +++ b/cib/cib.cpp @@ -3,7 +3,7 @@ using namespace icinga; int CIB::m_Types; -Ringbuffer CIB::m_TaskStatistics(15 * 60); +RingBuffer CIB::m_TaskStatistics(15 * 60); boost::signal CIB::OnServiceStatusUpdate; void CIB::RequireInformation(InformationType types) diff --git a/cib/cib.h b/cib/cib.h index 0077cec08..37fd9d5e1 100644 --- a/cib/cib.h +++ b/cib/cib.h @@ -25,7 +25,7 @@ public: private: static int m_Types; - static Ringbuffer m_TaskStatistics; + static RingBuffer m_TaskStatistics; }; }