---
title: llarp::util::CoDelQueue

---

# llarp::util::CoDelQueue



 [More...](#detailed-description)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[CoDelQueue](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-codelqueue)**(std::string name, PutTime put, GetNow now) |
| size_t | **[Size](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-size)**() |
| template <typename... Args\> <br>bool | **[EmplaceIf](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-emplaceif)**(std::function< bool(T &)> pred, Args &&... args) |
| template <typename... Args\> <br>void | **[Emplace](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-emplace)**(Args &&... args) |
| template <typename Visit \> <br>void | **[Process](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-process)**(Visit v) |
| template <typename Visit ,typename Filter \> <br>void | **[Process](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-process)**(Visit visitor, Filter f) |
| size_t m_QueueIdx | **[GUARDED_BY](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-guarded-by)**(m_QueueMutex ) |
| std::array< T, MaxSize > m_Queue | **[GUARDED_BY](Classes/structllarp_1_1util_1_1CoDelQueue.md#function-guarded-by)**(m_QueueMutex ) |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| const llarp_time_t | **[initialIntervalMs](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-initialintervalms)**  |
| const llarp_time_t | **[dropMs](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-dropms)**  |
| llarp_time_t | **[firstPut](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-firstput)**  |
| size_t | **[dropNum](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-dropnum)**  |
| llarp_time_t | **[nextTickInterval](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-nexttickinterval)**  |
| llarp_time_t | **[nextTickAt](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-nexttickat)**  |
| Mutex_t | **[m_QueueMutex](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-m-queuemutex)**  |
| std::string | **[m_name](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable-m-name)**  |
| GetTime | **[_getTime](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable--gettime)**  |
| PutTime | **[_putTime](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable--puttime)**  |
| GetNow | **[_getNow](Classes/structllarp_1_1util_1_1CoDelQueue.md#variable--getnow)**  |

## Detailed Description

```cpp
template <typename T ,
typename GetTime ,
typename PutTime ,
typename Compare ,
typename GetNow  =GetNowSyscall,
typename Mutex_t  =util::Mutex,
typename Lock_t  =std::lock_guard<Mutex_t>,
size_t MaxSize =1024>
struct llarp::util::CoDelQueue;
```

## Public Functions Documentation

### function CoDelQueue

```cpp
inline CoDelQueue(
    std::string name,
    PutTime put,
    GetNow now
)
```


### function Size

```cpp
inline size_t Size()
```


### function EmplaceIf

```cpp
template <typename... Args>
inline bool EmplaceIf(
    std::function< bool(T &)> pred,
    Args &&... args
)
```


### function Emplace

```cpp
template <typename... Args>
inline void Emplace(
    Args &&... args
)
```


### function Process

```cpp
template <typename Visit >
inline void Process(
    Visit v
)
```


### function Process

```cpp
template <typename Visit ,
typename Filter >
inline void Process(
    Visit visitor,
    Filter f
)
```


### function GUARDED_BY

```cpp
size_t m_QueueIdx GUARDED_BY(
    m_QueueMutex 
)
```


### function GUARDED_BY

```cpp
std::array< T, MaxSize > m_Queue GUARDED_BY(
    m_QueueMutex 
)
```


## Public Attributes Documentation

### variable initialIntervalMs

```cpp
const llarp_time_t initialIntervalMs = 5ms;
```


### variable dropMs

```cpp
const llarp_time_t dropMs = 100ms;
```


### variable firstPut

```cpp
llarp_time_t firstPut = 0s;
```


### variable dropNum

```cpp
size_t dropNum = 0;
```


### variable nextTickInterval

```cpp
llarp_time_t nextTickInterval = initialIntervalMs;
```


### variable nextTickAt

```cpp
llarp_time_t nextTickAt = 0s;
```


### variable m_QueueMutex

```cpp
Mutex_t m_QueueMutex;
```


### variable m_name

```cpp
std::string m_name;
```


### variable _getTime

```cpp
GetTime _getTime;
```


### variable _putTime

```cpp
PutTime _putTime;
```


### variable _getNow

```cpp
GetNow _getNow;
```


-------------------------------

Updated on 2022-04-18 at 19:54:45 +0000