From 0b18792b96b7a648d1d5e75c296aa7700fba6d5d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 16 Oct 2020 21:56:42 +0200 Subject: [PATCH] Document _DEF_AS macros Fix #60 --- README.md | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/README.md b/README.md index bebecd28..12137bc6 100644 --- a/README.md +++ b/README.md @@ -896,6 +896,11 @@ Example: } +#### LIST\_DEF\_AS(name, name\_t, name\_it\_t, type, [, oplist]) + +Same as LIST\_DEF except the name of the types name\_t, name\_it\_t +are provided. + #### LIST\_OPLIST(name [, oplist]) Return the oplist of the list defined by calling LIST\_DEF @@ -1185,6 +1190,11 @@ and cleared by calling mempool\_list\_name\_clear(variable). The methods follow closely the methods defined by LIST\_DEF. +#### LIST\_DUAL\_PUSH\_DEF\_AS(name, name\_t, name\_it\_t, type, [, oplist]) + +Same as LIST\_DUAL\_PUSH\_DEF except the name of the types name\_t, name\_it\_t +are provided. + #### Created methods In the following methods, name stands for the name given to the macro that is used to identify the type. @@ -1455,6 +1465,11 @@ Example: } +#### ARRAY\_DEF\_AS(name, name\_t, name\_it\_t, type, [, oplist]) + +Same as ARRAY\_DEF except the name of the types name\_t, name\_it\_t +are provided. + #### ARRAY\_OPLIST(name [, oplist]) Return the oplist of the array defined by calling ARRAY\_DEF with name & oplist. @@ -1793,6 +1808,11 @@ Example: } +#### DEQUE\_DEF\_AS(name, name\_t, name\_it\_t, type, [, oplist]) + +Same as DEQUE\_DEF except the name of the types name\_t, name\_it\_t +are provided. + #### DEQUE\_OPLIST(name [, oplist]) Return the oplist of the deque defined by calling DEQUE\_DEF with name & oplist. @@ -2094,6 +2114,21 @@ Example: dict_int_set_at (my_dict, key, value); } +#### DICT\_DEF2\_AS(name, name\_t, name\_it\_t, name\_itref\_t, key\_type[, key\_oplist], value\_type[, value\_oplist]) + +Same as DICT\_DEF2 except the name of the types name\_t, name\_it\_t, name\_itref\_t, +are provided. + +#### DICT\_STOREHASH\_DEF2\_AS(name, name\_t, name\_it\_t, name\_itref\_t, key\_type[, key\_oplist], value\_type[, value\_oplist]) + +Same as DICT\_STOREHASH\_DEF2 except the name of the types name\_t, name\_it\_t, name\_itref\_t, +are provided. + +#### DICT\_OA\_DEF2\_AS(name, name\_t, name\_it\_t, name\_itref\_t, key\_type[, key\_oplist], value\_type[, value\_oplist]) + +Same as DICT\_OA\_DEF2 except the name of the types name\_t, name\_it\_t, name\_itref\_t, +are provided. + #### DICT\_OPLIST(name[, key\_oplist, value\_oplist]) @@ -2138,6 +2173,17 @@ This implementation is in general faster for small types of keys (like integer) but slower for larger types. +#### DICT\_SET\_DEF\_AS(name, name\_t, name\_it\_t, name\_itref\_t, key\_type[, key\_oplist]) + +Same as DICT\_SET\_DEF except the name of the types name\_t, name\_it\_t, name\_itref\_t, +are provided. + +#### DICT\_OASET\_DEF\_AS(name, name\_t, name\_it\_t, name\_itref\_t, key\_type[, key\_oplist]) + +Same as DICT\_OASET\_DEF except the name of the types name\_t, name\_it\_t, name\_itref\_t, +are provided. + + #### DICT\_SET\_OPLIST(name[, key\_oplist]) Return the oplist of the set defined by calling DICT\_SET\_DEF (or DICT\_OASET\_DEF) with name & key\_oplist. @@ -2319,6 +2365,11 @@ Example: pair_clear(p1); } +#### TUPLE\_DEF2\_AS(name, name\_t, (element1, type1[, oplist1]) [, ...]) + +Same as TUPLE\_DEF2 except the name of the type name\_t +is provided. + #### TUPLE\_OPLIST(name, oplist1[, ...] ) Return the oplist of the tuple defined by calling TUPLE\_DEF2 with the given name & the oplists. @@ -2432,6 +2483,7 @@ Read from the file 'file' a string representation of a tuple and set 'tuple' to This method is only defined if all oplists define a IN\_STR method. + ### M-VARIANT A [variant](https://en.wikipedia.org/wiki/Variant_type) is a finite exclusive list of elements of different types : @@ -2467,6 +2519,12 @@ Example: either_clear(p1); } +#### VARIANT\_DEF2\_AS(name, name\_t, (element1, type1[, oplist1]) [, ...]) + +Same as VARIANT\_DEF2 except the name of the type name\_t +is provided. + + #### VARIANT\_OPLIST(name, oplist1[, ...] ) Return the oplist of the variant defined by calling VARIANT\_DEF2 with the given name & the oplists. @@ -2628,6 +2686,12 @@ Example: rbtree_uint_clear(tree); } +#### RBTREE\_DEF\_AS(name, name\_t, name\_it\_t, type[, oplist]) + +Same as RBTREE\_DEF2 except the name of the types name\_t, name\_it\_t +are provided. + + #### RBTREE\_OPLIST(name [, oplist]) Return the oplist of the Red-Black defined by calling RBTREE\_DEF with name & oplist. @@ -2807,6 +2871,8 @@ This method is only defined if the type of the element defines a EQUAL method it Return the hash of the tree. This method is only defined if the type of the element defines a HASH method itself. + + ### M-BPTREE A [B+TREE](https://en.wikipedia.org/wiki/B%2B_tree) is a variant of @@ -2853,6 +2919,11 @@ Example: tree_uint_clear(tree); } +#### BPTREE\_DEF2\_AS(name, name\_t, name\_it\_t, name\_itref\_t, N, key_type, key_oplist, value, value_oplist) + +Same as BPTREE\_DEF2 except the name of the types name\_t, name\_it\_t, name\_itref\_t +are provided. + #### BPTREE\_OPLIST2(name, key_oplist, value_oplist) Return the oplist of the BPTREE defined by calling BPTREE\_DEF2 with name, key_oplist @@ -2888,6 +2959,11 @@ Example: tree_uint_clear(tree); } +#### BPTREE\_DEF\_AS(name, name\_t, name\_it\_t, name\_itref\_t, N, key_type, key_oplist) + +Same as BPTREE\_DEF except the name of the types name\_t, name\_it\_t, name\_itref\_t +are provided. + #### BPTREE\_OPLIST(name[, key_oplist]) Return the oplist of the BPTREE defined by calling BPTREE\_DEF with name, key_oplist. @@ -2906,6 +2982,11 @@ the value associated to the key). See BPTREE\_DEF2 for additional details and example. +#### BPTREE\_MULTI\_DEF2\_AS(name, name\_t, name\_it\_t, name\_itref\_t, N, key_type, key_oplist, value, value_oplist) + +Same as BPTREE\_MULTI\_DEF2 except the name of the types name\_t, name\_it\_t, name\_itref\_t +are provided. + #### BPTREE\_MULTI\_DEF(name, N, key_type[, key_oplist]) Define the B+TREE tree of rank N 'name##\_t' and its associated methods as @@ -2918,6 +2999,12 @@ the key value). See BPTREE\_DEF for additional details and example. +#### BPTREE\_MULTI\_DEF\_AS(name, name\_t, name\_it\_t, name\_itref\_t, N, key_type, key_oplist) + +Same as BPTREE\_MULTI\_DEF except the name of the types name\_t, name\_it\_t, name\_itref\_t +are provided. + + #### Created methods The following methods are automatically and properly created by the previous macros. @@ -3125,6 +3212,12 @@ otherwise default operators are used. If there is no given oplist, the default o or a globally registered oplist is used. The created methods will use the operators to init, set and clear the contained object. + +#### PRIOQUEUE\_DEF\_AS(name, name\_t, name\_it\_t, type [, oplist]) + +Same as PRIOQUEUE\_DEF except the name of the types name\_t, name\_it\_t +are provided. + #### PRIOQUEUE\_OPLIST(name, [, oplist]) Define the oplist of the prioqueue defined with 'name' and potentially 'oplist'. @@ -3307,6 +3400,12 @@ Example: } +#### BUFFER\_DEF\_AS(name, name\_t, type, size, policy[, oplist]) + +Same as BUFFER\_DEF except the name of the type name\_t +is provided. + + #### Created methods The following methods are automatically and properly created by the previous macros. In the following methods, name stands for the name given to the macro that is used to identify the type. @@ -3430,6 +3529,12 @@ or a globally registered oplist is used. The created methods will use the operators to init, set and clear the contained object. It supports also INIT\_MOVE if available. +#### QUEUE\_MPMC\_DEF\_AS(name, name\_t, type, policy[, oplist]) + +Same as QUEUE\_MPMC\_DEF except the name of the type name\_t +is provided. + + #### Created methods The following methods are automatically and properly created by the previous macros. @@ -3518,6 +3623,11 @@ or a globally registered oplist is used. The created methods will use the operators to init, set and clear the contained object. It supports also INIT\_MOVE if available. +#### QUEUE\_SPSC\_DEF\_AS(name, name\_t, type, policy[, oplist]) + +Same as QUEUE\_MPMC\_DEF except the name of the type name\_t +is provided. + #### Created methods The following methods are automatically and properly created by the previous macros. @@ -3675,6 +3785,11 @@ Example: } +#### SNAPSHOT\_SPSC\_DEF\_AS(name, name\_t, type[, oplist]) + +Same as SNAPSHOT\_SPSC\_DEF except the name of the type name\_t +is provided. + #### Created methods The following methods are automatically and properly created by the previous macros. In the following methods, name stands for the name given to the macro that is used to identify the type. @@ -3796,6 +3911,11 @@ Example: } +#### SHARED\_PTR\_DEF\_AS(name, name\_t, type[, oplist]) + +Same as SHARED\_PTR\_DEF except the name of the type name\_t +is provided. + #### Created methods The following methods are automatically and properly created by the previous macros. In the following methods, name stands for the name given to the macro that is used to identify the type. @@ -3941,6 +4061,12 @@ Example: } +#### ISHARED\_PTR\_DEF\_AS(name, name\_t, type[, oplist]) + +Same as ISHARED\_PTR\_DEF except the name of the type name\_t +is provided. + + #### Created methods The following methods are automatically and properly created by the previous macros. In the following methods, name stands for the name given to the macro that is used to identify the type. @@ -4066,6 +4192,11 @@ Example: } +#### ILIST\_DEF\_AS(name, name\_t, name\_it\_t, type[, oplist]) + +Same as SNAPSHOT\_SPSC\_DEF except the name of the types name\_t, name\_it\_t +are provided. + #### Created methods The following methods are automatically and properly created by the previous macros. In the following methods, name stands for the name given to the macro that is used to identify the type. @@ -4270,6 +4401,11 @@ Example: cdeque_uint_push (x2, 17); } +#### CONCURRENT\_DEF\_AS(name, name\_t, type[, oplist]) + +Same as CONCURRENT\_DEF except the name of the type name\_t +is provided. + #### Created methods @@ -6750,6 +6886,11 @@ and with as inputs the list of types of paramN: An interface cannot be used without an instance that implements this interface. It will define the following type and functions: +#### FUNC\_OBJ\_ITF\_DEF\_AS(name, name\_t, retcode\_type[, type\_of\_param1, type\_of\_param 2, ...]) + +Same as FUNC\_OBJ\_ITF\_DEF except the name of the type name\_t +is provided. + ##### name\_t Name of the interface type representing an interface to the function object. @@ -6782,6 +6923,11 @@ The function is defined as per : callback_core } +#### FUNC\_OBJ\_INS\_DEF\_AS(name, name\_t, interface_name, (param_name_1, ...), { callback_core }, (self_member1, self_type1[, self_oplist1]), ...) + +Same as FUNC\_OBJ\_INS\_DEF except the name of the type name\_t +is provided. + ##### name\_t Name of a particular instance to the interface of the Function Object interface\_name.