5 `CX_COLLECTION_BASE` macro at the beginning of your struct to roll out all members a usual UCX collection has. |
5 `CX_COLLECTION_BASE` macro at the beginning of your struct to roll out all members a usual UCX collection has. |
6 |
6 |
7 This macro will embed a structure in your collection that can be accessed with the member name `collection`. |
7 This macro will embed a structure in your collection that can be accessed with the member name `collection`. |
8 |
8 |
9 ```c |
9 ```c |
|
10 #include <cx/collection.h> |
|
11 |
10 struct my_fancy_collection_s { |
12 struct my_fancy_collection_s { |
11 CX_COLLECTION_BASE; // adds a member named 'collection' |
13 CX_COLLECTION_BASE; // adds a member named 'collection' |
12 struct my_collection_data_s *data; |
14 struct my_collection_data_s *data; |
13 }; |
15 }; |
14 ``` |
16 ``` |