Change the generated '_impl.h' to support a '#define <interface_name.upper()>_SELF_H ' to specify the name of the 'self' typedef.
Currently, the impl_ function for each method has a first parameter that is a 'const _t instance' and most function implementations have as their first line an assign to a self variable that is not const and is a cast of instance to this self typedef. The typedef for self always have `_t pub' as it's first member followed by any implementation specific members.
Example, in typedef for self in internal header:
typedef struct afw_pool_internal_singlethreaded_self_s
afw_pool_internal_singlethreaded_self_t;
struct afw_pool_internal_singlethreaded_self_s {
afw_pool_t pub;
/* Other instance specific members. */
...
};
This change will allow a <interface_name.upper()>_SELF_T macro to be defined before the include of the _impl_declares.h to specify the name of the implementation specific self typedef.
Change the generated '_impl.h' to support a '#define <interface_name.upper()>_SELF_H ' to specify the name of the 'self' typedef.
Currently, the impl_ function for each method has a first parameter that is a 'const_t instance' and most function implementations have as their first line an assign to a self variable that is not const and is a cast of instance to this self typedef. The typedef for self always have `_t pub' as it's first member followed by any implementation specific members.
Example, in typedef for self in internal header:
Then in the implementation of a interface:
This change will allow a <interface_name.upper()>_SELF_T macro to be defined before the include of the_impl_declares.h to specify the name of the implementation specific self typedef.
The above can change to this:
This issue will also change the interface skeletons to include this new define and remove the commented out assign in each method skeleton.
This change will remove an unnecessary assignment when calling each method at both execution time and coding time.
As part of this issue, change some or all of the existing implementations to use the new #define.