cvx
Loading...
Searching...
No Matches
bidirectional_iterator.h
Go to the documentation of this file.
1
#include "cvx/fallback.h"
2
3
// clang-format off
4
#ifndef V
5
#error "cvx/iter/bidirectional_iterator.h requires V to be defined (the element type, e.g. #define V int)"
6
#endif
7
#ifndef INTERFACE
8
#error "cvx/iter/bidirectional_iterator.h requires INTERFACE to be defined (the struct name, e.g. #define INTERFACE my_iter)"
9
#endif
10
// clang-format on
11
12
#include "
cvx/core.h
"
13
14
struct
VTABLE(INTERFACE)
15
{
16
// constructors and destructors
17
cvx_container
*(*start)(
cvx_container
*);
18
cvx_container
*(*end)(
cvx_container
*);
19
void (*drop)(
cvx_container
*);
20
// state
21
bool (*at_start)(
cvx_container
*);
22
bool (*at_end)(
cvx_container
*);
23
size_t (*count)(
cvx_container
*);
24
// movement
25
void (*to_start)(
cvx_container
*);
26
void (*to_end)(
cvx_container
*);
27
void (*next)(
cvx_container
*);
28
void (*prev)(
cvx_container
*);
29
void (*forward)(
cvx_container
*,
size_t
steps);
30
void (*backward)(
cvx_container
*,
size_t
steps);
31
// access
32
V (*value)(
cvx_container
*);
33
size_t (*index)(
cvx_container
*);
34
};
35
36
struct
INTERFACE
37
{
38
cvx_container
*instance;
39
struct
VTABLE(INTERFACE) * vtable;
40
};
41
42
#undef INTERFACE
core.h
INTERFACE
Definition
deque.h:30
cvx_container
Definition
binary_heap.h:135
cvx
iter
bidirectional_iterator.h
Generated by
1.9.8