Derive-C
Loading...
Searching...
No Matches
trait.h File Reference

Go to the source code of this file.

Macros

#define DC_TRAIT_QUEUE(SELF)

Macro Definition Documentation

◆ DC_TRAIT_QUEUE

#define DC_TRAIT_QUEUE ( SELF)
Value:
DC_REQUIRE_METHOD(bool, SELF, empty, (SELF const*)); \
DC_REQUIRE_METHOD(size_t, SELF, size, (SELF const*)); \
DC_REQUIRE_METHOD(bool, SELF, empty, (SELF const*)); \
DC_REQUIRE_METHOD(void, SELF, push_front, (SELF*, NS(SELF, item_t))); \
DC_REQUIRE_METHOD(void, SELF, push_back, (SELF*, NS(SELF, item_t))); \
DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, try_read_from_back, (SELF const*, size_t)); \
DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, try_read_from_front, (SELF const*, size_t)); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_write_from_front, (SELF*, size_t)); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_write_from_back, (SELF*, size_t)); \
DC_REQUIRE_METHOD(NS(SELF, item_t), SELF, pop_front, (SELF*)); \
DC_REQUIRE_METHOD(NS(SELF, item_t), SELF, pop_back, (SELF*)); \
DC_TRAIT_ITERABLE(SELF); \
DC_TRAIT_DELETABLE(SELF); \
DC_TRAIT_CLONEABLE(SELF); \
DC_TRAIT_DEBUGABLE(SELF);
static bool empty(ITER const *iter)
Definition template.h:346
static INDEX_TYPE size(SELF const *self)
Definition template.h:252
static ITEM pop_front(SELF *self)
Definition template.h:216
static ITEM * try_write_from_back(SELF *self, size_t index)
Definition template.h:281
static ITEM pop_back(SELF *self)
Definition template.h:235
static ITEM * try_write_from_front(SELF *self, size_t index)
Definition template.h:277
static void push_back(SELF *self, ITEM item)
Definition template.h:184
static ITEM const * try_read_from_back(SELF const *self, size_t index)
Definition template.h:265
static ITEM const * try_read_from_front(SELF const *self, size_t index)
Definition template.h:255
static void push_front(SELF *self, ITEM item)
Definition template.h:198
#define NS(pre, post)
Definition namespace.h:4
#define DC_REQUIRE_TYPE(obj, name)
Definition require.h:21
#define SELF
Definition def.h:52
A queue comprised of an extendable circular buffer.
Definition template.h:16

Definition at line 5 of file trait.h.

5#define DC_TRAIT_QUEUE(SELF) \
6 DC_REQUIRE_TYPE(SELF, item_t); \
7 DC_REQUIRE_METHOD(bool, SELF, empty, (SELF const*)); \
8 DC_REQUIRE_METHOD(size_t, SELF, size, (SELF const*)); \
9 DC_REQUIRE_METHOD(bool, SELF, empty, (SELF const*)); \
10 DC_REQUIRE_METHOD(void, SELF, push_front, (SELF*, NS(SELF, item_t))); \
11 DC_REQUIRE_METHOD(void, SELF, push_back, (SELF*, NS(SELF, item_t))); \
12 DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, try_read_from_back, (SELF const*, size_t)); \
13 DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, try_read_from_front, (SELF const*, size_t)); \
14 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_write_from_front, (SELF*, size_t)); \
15 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_write_from_back, (SELF*, size_t)); \
16 DC_REQUIRE_METHOD(NS(SELF, item_t), SELF, pop_front, (SELF*)); \
17 DC_REQUIRE_METHOD(NS(SELF, item_t), SELF, pop_back, (SELF*)); \
18 DC_TRAIT_ITERABLE(SELF); \
19 DC_TRAIT_DELETABLE(SELF); \
20 DC_TRAIT_CLONEABLE(SELF); \
21 DC_TRAIT_DEBUGABLE(SELF);