Derive-C
Loading...
Searching...
No Matches
trait.h File Reference
#include <derive-c/core/prelude.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define DC_TRAIT_BITSET(SELF)

Macro Definition Documentation

◆ DC_TRAIT_BITSET

#define DC_TRAIT_BITSET ( SELF)
Value:
DC_REQUIRE_CONSTANT(SELF, max_index, NS(SELF, index_t)); \
DC_REQUIRE_CONSTANT(SELF, min_index, NS(SELF, index_t)); \
DC_REQUIRE_METHOD(bool, SELF, try_set, (SELF*, NS(SELF, index_t), bool)); \
DC_REQUIRE_METHOD(void, SELF, set, (SELF*, NS(SELF, index_t), bool)); \
DC_REQUIRE_METHOD(bool, SELF, get, (SELF const*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(size_t, SELF, size, (SELF const*)); \
DC_TRAIT_ITERABLE(SELF); \
DC_TRAIT_CONST_ITERABLE(SELF); \
DC_TRAIT_CLONEABLE(SELF); \
DC_TRAIT_DELETABLE(SELF); \
DC_TRAIT_DEBUGABLE(SELF)
static DC_PUBLIC size_t size(SELF const *self)
Definition template.h:252
static DC_PUBLIC bool try_set(SELF *self, INDEX_TYPE index, bool value)
Definition template.h:47
static DC_PUBLIC bool get(SELF const *self, INDEX_TYPE index)
Definition template.h:80
INDEX_TYPE index_t
Definition template.h:26
static DC_PUBLIC void set(SELF *self, INDEX_TYPE index, bool value)
Definition template.h:73
DC_STATIC_CONSTANT INDEX_TYPE max_index
Definition template.h:28
DC_STATIC_CONSTANT INDEX_TYPE min_index
Definition template.h:29
#define SELF
Definition def.h:52
#define NS(pre, post)
Definition namespace.h:14
#define DC_REQUIRE_TYPE(obj, name)
Definition require.h:25

Definition at line 6 of file trait.h.

6#define DC_TRAIT_BITSET(SELF) \
7 DC_REQUIRE_TYPE(SELF, index_t); \
8 DC_REQUIRE_CONSTANT(SELF, max_index, NS(SELF, index_t)); \
9 DC_REQUIRE_CONSTANT(SELF, min_index, NS(SELF, index_t)); \
10 DC_REQUIRE_METHOD(bool, SELF, try_set, (SELF*, NS(SELF, index_t), bool)); \
11 DC_REQUIRE_METHOD(void, SELF, set, (SELF*, NS(SELF, index_t), bool)); \
12 DC_REQUIRE_METHOD(bool, SELF, get, (SELF const*, NS(SELF, index_t))); \
13 DC_REQUIRE_METHOD(size_t, SELF, size, (SELF const*)); \
14 DC_TRAIT_ITERABLE(SELF); \
15 DC_TRAIT_CONST_ITERABLE(SELF); \
16 DC_TRAIT_CLONEABLE(SELF); \
17 DC_TRAIT_DELETABLE(SELF); \
18 DC_TRAIT_DEBUGABLE(SELF)