diff --git a/applications/test/CircularBuffer/Test-CircularBuffer.C b/applications/test/CircularBuffer/Test-CircularBuffer.C index 98cde44170..88de900886 100644 --- a/applications/test/CircularBuffer/Test-CircularBuffer.C +++ b/applications/test/CircularBuffer/Test-CircularBuffer.C @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) Info<< buf1[-12] << nl; - Info<< "found: " << buf1.found(40) << nl; + Info<< "contains: " << buf1.contains(40) << nl; buf1.push_uniq(100); report(buf1); buf1 = Zero; report(buf1); diff --git a/src/OpenFOAM/containers/Buffers/CircularBuffer.H b/src/OpenFOAM/containers/Buffers/CircularBuffer.H index 2c19b78444..47de665f71 100644 --- a/src/OpenFOAM/containers/Buffers/CircularBuffer.H +++ b/src/OpenFOAM/containers/Buffers/CircularBuffer.H @@ -232,17 +232,16 @@ public: //- The contents of the first internal array SubList array_one(); - //- The contents of the first internal array + //- The contents of the second internal array SubList array_two(); - //- The contents of the second internal array + //- The contents of the first internal array const SubList array_one() const; //- The contents of the second internal array const SubList array_two() const; - // Access //- Access the first element (front). Requires !empty(). @@ -352,9 +351,6 @@ public: // Member Operators - //- Return the buffer flattened as a single List. Use sparingly! - List operator()() const { return this->list(); } - //- Non-const access to an element in the list. // The index is allowed to wrap in both directions inline T& operator[](const label i); @@ -489,47 +485,6 @@ public: //- Return a const_iterator at end of buffer inline const_iterator end() const { return cend(); } - - - // Housekeeping - - //- Same as contains() - bool found(const T& val, label pos = 0) const - { - return contains(val, pos); - } - - //- Access the first element (front). Requires !empty(). - //FOAM_DEPRECATED_FOR(2022-10, "front()") - T& first() { return front(); } - - //- Access the first element (front). Requires !empty(). - //FOAM_DEPRECATED_FOR(2022-10, "front()") - const T& first() const { return front(); } - - //- Access the last element (back). Requires !empty(). - //FOAM_DEPRECATED_FOR(2022-10, "back()") - T& last() { return back(); } - - //- Access the last element (back). Requires !empty(). - //FOAM_DEPRECATED_FOR(2022-10, "back()") - const T& last() const { return back(); } - - //- Copy append an element to the end of the buffer - //FOAM_DEPRECATED_FOR(2022-10, "push_back()") - void append(const T& val) { this->push_back(val); } - - //- Move append an element to the end of the buffer - //FOAM_DEPRECATED_FOR(2022-10, "push_back()") - void append(T&& val) { this->push_back(std::move(val)); } - - //- Copy append multiple elements the end of the buffer - //FOAM_DEPRECATED_FOR(2022-10, "push_back()") - void append(const UList& list) { this->push_back(list); } - - //- Same as push_uniq() - FOAM_DEPRECATED_STRICT(2022-10, "push_uniq()") - label appendUniq(const T& val) { return this->push_uniq(val); } }; diff --git a/src/OpenFOAM/containers/Buffers/CircularBufferI.H b/src/OpenFOAM/containers/Buffers/CircularBufferI.H index b7f71671f6..45a1a40d1c 100644 --- a/src/OpenFOAM/containers/Buffers/CircularBufferI.H +++ b/src/OpenFOAM/containers/Buffers/CircularBufferI.H @@ -160,6 +160,7 @@ inline Foam::CircularBuffer::CircularBuffer template inline Foam::label Foam::CircularBuffer::capacity() const noexcept { + // or storage_.capacity(); return storage_.size(); }