# InputQueue

固定長キュー`FixedQueue`を利用し、入力キューとしていくつかのメソッドを追加しています。

```cpp
template <typename T>
class InputQueue
```

* キューが一杯になった後に`push()`で要素を追加した場合は、末尾の要素を抹消して追加します。

## 定義・メンバー変数

```cpp
protected:
		std::unique_ptr<TWEUTILS::FixedQueue<T>> _cue;
```

## メソッド

### FixedQueue() - コンストラクタ

```cpp
InputQueue(size_type n)
```

`n`を最大値としてキューを初期化・生成します。

### setup()

```cpp
void setup(size_type n)
```

`n`を最大値としてキューを初期化・生成します。

### push()

```cpp
void push(T c)
```

キューに要素を追加します。

キューが一杯になった後に`push()`で要素を追加した場合は、末尾の要素を抹消して追加します。

### pop\_front(), read()

```cpp
T pop_front()
T read()
```

キューの先頭要素を戻り値し、またキューよりその要素を削除します。

### is\_full()

```cpp
bool is_full()
```

キューが一杯になると`true`を返します。

### available()

```
int available()
```

キューに要素があれば`true(!=0)`、なければ`false(==0)`といった判定を目的とします。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mwm5.twelite.info/0.9-1/references/basics/tweutils/inputqueue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
