cvx
Loading...
Searching...
No Matches
deque.h
Go to the documentation of this file.
1#include "cvx/fallback.h"
2
3// clang-format off
4#ifndef V
5#error "cvx/interface/deque.h requires V to be defined (the element type, e.g. #define V int)"
6#endif
7#ifndef INTERFACE
8#error "cvx/interface/deque.h requires INTERFACE to be defined (the struct name, e.g. #define INTERFACE my_deque)"
9#endif
10// clang-format on
11
12#include "cvx/core.h"
13
14struct VTABLE(INTERFACE)
15{
16 // constructors and destructors
17 void (*drop)(cvx_container *);
18 // operations
19 void (*push_front)(cvx_container *, V);
20 void (*push_back)(cvx_container *, V);
21 V (*pop_front)(cvx_container *);
22 V (*pop_back)(cvx_container *);
23 V (*peek_front)(cvx_container *);
24 V (*peek_back)(cvx_container *);
25 // state
26 size_t (*count)(cvx_container *);
27};
28
30{
32 struct VTABLE(INTERFACE) * vtable;
33};
34
35#include "cvx/undef.h"
Definition deque.h:30
cvx_container * instance
Definition deque.h:31
struct INTERFACE_vtable * vtable
Definition deque.h:32
Definition binary_heap.h:135