util/FifoBuffer: rename to StaticFifoBuffer
This commit is contained in:
parent
1f3d3970f6
commit
ea26da0be7
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "check.h"
|
#include "check.h"
|
||||||
#include "SocketMonitor.hxx"
|
#include "SocketMonitor.hxx"
|
||||||
#include "util/FifoBuffer.hxx"
|
#include "util/StaticFifoBuffer.hxx"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -34,7 +34,7 @@ class EventLoop;
|
|||||||
* A #SocketMonitor specialization that adds an input buffer.
|
* A #SocketMonitor specialization that adds an input buffer.
|
||||||
*/
|
*/
|
||||||
class BufferedSocket : protected SocketMonitor {
|
class BufferedSocket : protected SocketMonitor {
|
||||||
FifoBuffer<uint8_t, 8192> input;
|
StaticFifoBuffer<uint8_t, 8192> input;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BufferedSocket(int _fd, EventLoop &_loop)
|
BufferedSocket(int _fd, EventLoop &_loop)
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifndef MPD_TEXT_INPUT_STREAM_HXX
|
#ifndef MPD_TEXT_INPUT_STREAM_HXX
|
||||||
#define MPD_TEXT_INPUT_STREAM_HXX
|
#define MPD_TEXT_INPUT_STREAM_HXX
|
||||||
|
|
||||||
#include "util/FifoBuffer.hxx"
|
#include "util/StaticFifoBuffer.hxx"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ class InputStream;
|
|||||||
|
|
||||||
class TextInputStream {
|
class TextInputStream {
|
||||||
InputStream &is;
|
InputStream &is;
|
||||||
FifoBuffer<char, 4096> buffer;
|
StaticFifoBuffer<char, 4096> buffer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2010 Max Kellermann <max@duempel.org>
|
* Copyright (C) 2003-2014 Max Kellermann <max@duempel.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -27,8 +27,8 @@
|
|||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FIFO_BUFFER_HPP
|
#ifndef STATIC_FIFO_BUFFER_HPP
|
||||||
#define FIFO_BUFFER_HPP
|
#define STATIC_FIFO_BUFFER_HPP
|
||||||
|
|
||||||
#include "WritableBuffer.hxx"
|
#include "WritableBuffer.hxx"
|
||||||
|
|
||||||
@ -44,7 +44,7 @@
|
|||||||
* buffer as needed. It is not thread safe.
|
* buffer as needed. It is not thread safe.
|
||||||
*/
|
*/
|
||||||
template<class T, size_t size>
|
template<class T, size_t size>
|
||||||
class FifoBuffer {
|
class StaticFifoBuffer {
|
||||||
public:
|
public:
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr
|
constexpr
|
||||||
FifoBuffer():head(0), tail(0) {}
|
StaticFifoBuffer():head(0), tail(0) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Shift() {
|
void Shift() {
|
@ -28,7 +28,7 @@
|
|||||||
#include "AudioFormat.hxx"
|
#include "AudioFormat.hxx"
|
||||||
#include "pcm/PcmConvert.hxx"
|
#include "pcm/PcmConvert.hxx"
|
||||||
#include "config/ConfigGlobal.hxx"
|
#include "config/ConfigGlobal.hxx"
|
||||||
#include "util/FifoBuffer.hxx"
|
#include "util/StaticFifoBuffer.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
#include "stdbin.h"
|
#include "stdbin.h"
|
||||||
@ -81,7 +81,7 @@ int main(int argc, char **argv)
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FifoBuffer<uint8_t, 4096> buffer;
|
StaticFifoBuffer<uint8_t, 4096> buffer;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user