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

Go to the source code of this file.

Macros

#define DC_TRAIT_VECTOR(SELF)

Macro Definition Documentation

◆ DC_TRAIT_VECTOR

#define DC_TRAIT_VECTOR ( SELF)
Value:
DC_REQUIRE_TYPE(SELF, index_t); \
DC_REQUIRE_CONSTANT(SELF, max_size, size_t); \
DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, read, (SELF const*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, try_read, (SELF const*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, write, (SELF*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_write, (SELF*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_insert_at, \
(SELF*, NS(SELF, index_t), NS(SELF, item_t) const*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(void, SELF, remove_at, (SELF*, NS(SELF, index_t), NS(SELF, index_t))); \
DC_REQUIRE_METHOD(bool, SELF, try_pop, (SELF*, NS(SELF, item_t)*)); \
DC_REQUIRE_METHOD(NS(SELF, item_t), SELF, pop, (SELF*)); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_push, (SELF*, NS(SELF, item_t))); \
DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, push, (SELF*, NS(SELF, item_t))); \
DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, size, (SELF const*)); \
DC_TRAIT_ITERABLE(SELF); \
DC_TRAIT_CONST_ITERABLE(SELF); \
DC_TRAIT_DELETABLE(SELF); \
DC_TRAIT_CLONEABLE(SELF); \
DC_TRAIT_DEBUGABLE(SELF)
static DC_PUBLIC VALUE const * try_read(SELF const *self, INDEX index)
Definition template.h:180
static DC_PUBLIC VALUE * try_write(SELF *self, INDEX index)
Definition template.h:205
static DC_PUBLIC VALUE const * read(SELF const *self, INDEX index)
Definition template.h:199
static DC_PUBLIC VALUE * write(SELF *self, INDEX index)
Definition template.h:209
static DC_PUBLIC size_t size(SELF const *self)
Definition template.h:252
INDEX_TYPE index_t
Definition template.h:26
static DC_PUBLIC ITEM * try_push(SELF *self, ITEM item)
Definition template.h:232
DC_STATIC_CONSTANT size_t max_size
Definition template.h:56
static DC_PUBLIC bool try_pop(SELF *self, ITEM *destination)
Definition template.h:270
static DC_PUBLIC ITEM * try_insert_at(SELF *self, size_t at, ITEM const *items, size_t count)
Definition template.h:190
static DC_PUBLIC void remove_at(SELF *self, size_t at, size_t count)
Definition template.h:211
static DC_PUBLIC ITEM * push(SELF *self, ITEM item)
Definition template.h:263
static DC_PUBLIC ITEM pop(SELF *self)
Definition template.h:289
#define SELF
Definition def.h:52
#define NS(pre, post)
Definition namespace.h:14
#define DC_REQUIRE_TYPE(obj, name)
Definition require.h:25
A queue comprised of an extendable circular buffer.
Definition template.h:16

Definition at line 5 of file trait.h.

5#define DC_TRAIT_VECTOR(SELF) \
6 DC_REQUIRE_TYPE(SELF, item_t); \
7 DC_REQUIRE_TYPE(SELF, index_t); \
8 DC_REQUIRE_CONSTANT(SELF, max_size, size_t); \
9 DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, read, (SELF const*, NS(SELF, index_t))); \
10 DC_REQUIRE_METHOD(NS(SELF, item_t) const*, SELF, try_read, (SELF const*, NS(SELF, index_t))); \
11 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, write, (SELF*, NS(SELF, index_t))); \
12 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_write, (SELF*, NS(SELF, index_t))); \
13 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_insert_at, \
14 (SELF*, NS(SELF, index_t), NS(SELF, item_t) const*, NS(SELF, index_t))); \
15 DC_REQUIRE_METHOD(void, SELF, remove_at, (SELF*, NS(SELF, index_t), NS(SELF, index_t))); \
16 DC_REQUIRE_METHOD(bool, SELF, try_pop, (SELF*, NS(SELF, item_t)*)); \
17 DC_REQUIRE_METHOD(NS(SELF, item_t), SELF, pop, (SELF*)); \
18 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, try_push, (SELF*, NS(SELF, item_t))); \
19 DC_REQUIRE_METHOD(NS(SELF, item_t)*, SELF, push, (SELF*, NS(SELF, item_t))); \
20 DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, size, (SELF const*)); \
21 DC_TRAIT_ITERABLE(SELF); \
22 DC_TRAIT_CONST_ITERABLE(SELF); \
23 DC_TRAIT_DELETABLE(SELF); \
24 DC_TRAIT_CLONEABLE(SELF); \
25 DC_TRAIT_DEBUGABLE(SELF)