Define valptridx factory typedef earlier
This commit is contained in:
parent
3ad6972a03
commit
666539b88f
|
@ -157,6 +157,20 @@ public:
|
|||
typedef ptr<vc, 0> vcptr;
|
||||
typedef ptr<vm, 0> vmptr;
|
||||
|
||||
#define DXX_VALPTRIDX_MC_qualifier_m
|
||||
#define DXX_VALPTRIDX_MC_qualifier_c const
|
||||
#define DXX_VALPTRIDX_DECLARE_MEMBER_FACTORIES(MANAGED_TYPE, DERIVED_TYPE_PREFIX, CONTEXT, PISUFFIX, IVPREFIX, MCPREFIX) \
|
||||
using f ## IVPREFIX ## MCPREFIX ## PISUFFIX = \
|
||||
DXX_VALPTRIDX_MC_qualifier_ ## MCPREFIX \
|
||||
basic_ ## IVPREFIX ## val_member_factory< \
|
||||
IVPREFIX ## c ## PISUFFIX, \
|
||||
IVPREFIX ## m ## PISUFFIX \
|
||||
>
|
||||
DXX_VALPTRIDX_FOR_EACH_PPI_TYPE(DXX_VALPTRIDX_DECLARE_MEMBER_FACTORIES,,,);
|
||||
#undef DXX_VALPTRIDX_DECLARE_MEMBER_FACTORIES
|
||||
#undef DXX_VALPTRIDX_MC_qualifier_c
|
||||
#undef DXX_VALPTRIDX_MC_qualifier_m
|
||||
|
||||
/* Commit a DRY violation here so that tools can easily find these
|
||||
* types. Strict DRY compliance would mean using a macro to
|
||||
* generate the `using` line, since the typedef, the dispatcher type
|
||||
|
@ -178,9 +192,13 @@ public:
|
|||
};
|
||||
};
|
||||
|
||||
#define DXX_VALPTRIDX_DEFINE_FACTORY_TYPEDEF(MANAGED_TYPE, DERIVED_TYPE_PREFIX, CONTEXT, PISUFFIX, IVPREFIX, MCPREFIX) \
|
||||
using f ## IVPREFIX ## MCPREFIX ## DERIVED_TYPE_PREFIX ## PISUFFIX = valptridx<MANAGED_TYPE>::f ## IVPREFIX ## MCPREFIX ## PISUFFIX
|
||||
|
||||
#define DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEF(MANAGED_TYPE, DERIVED_TYPE_PREFIX, CONTEXT, PISUFFIX, IVPREFIX, MCPREFIX) \
|
||||
using IVPREFIX ## MCPREFIX ## DERIVED_TYPE_PREFIX ## PISUFFIX ## _t = valptridx<MANAGED_TYPE>::IVPREFIX ## MCPREFIX ## PISUFFIX
|
||||
|
||||
#define DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEFS(MANAGED_TYPE, DERIVED_TYPE_PREFIX) \
|
||||
using MANAGED_TYPE ## _array = valptridx<MANAGED_TYPE>::array_managed_type; \
|
||||
DXX_VALPTRIDX_FOR_EACH_PPI_TYPE(DXX_VALPTRIDX_DEFINE_FACTORY_TYPEDEF, MANAGED_TYPE, DERIVED_TYPE_PREFIX,); \
|
||||
DXX_VALPTRIDX_FOR_EACH_IPPI_TYPE(DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEF, MANAGED_TYPE, DERIVED_TYPE_PREFIX,)
|
||||
|
|
|
@ -45,9 +45,6 @@
|
|||
#define DXX_VALPTRIDX_WARN_CALL_NOT_OPTIMIZED_OUT
|
||||
#endif
|
||||
|
||||
#define DXX_VALPTRIDX_MC_qualifier_m
|
||||
#define DXX_VALPTRIDX_MC_qualifier_c const
|
||||
|
||||
template <typename managed_type>
|
||||
class valptridx<managed_type>::array_base_count_type
|
||||
{
|
||||
|
@ -60,11 +57,8 @@ protected:
|
|||
* specializations.
|
||||
*/
|
||||
#define DXX_VALPTRIDX_DEFINE_MEMBER_FACTORIES(MANAGED_TYPE, DERIVED_TYPE_PREFIX, CONTEXT, PISUFFIX, IVPREFIX, MCPREFIX) \
|
||||
DXX_VALPTRIDX_MC_qualifier_ ## MCPREFIX \
|
||||
valptridx<MANAGED_TYPE>::basic_ ## IVPREFIX ## val_member_factory< \
|
||||
valptridx<MANAGED_TYPE>::IVPREFIX ## c ## PISUFFIX, \
|
||||
valptridx<MANAGED_TYPE>::IVPREFIX ## m ## PISUFFIX \
|
||||
> IVPREFIX ## MCPREFIX ## PISUFFIX
|
||||
valptridx<MANAGED_TYPE>::f ## IVPREFIX ## MCPREFIX ## PISUFFIX \
|
||||
IVPREFIX ## MCPREFIX ## PISUFFIX
|
||||
DXX_VALPTRIDX_FOR_EACH_PPI_TYPE(DXX_VALPTRIDX_DEFINE_MEMBER_FACTORIES, managed_type,,);
|
||||
#undef DXX_VALPTRIDX_DEFINE_MEMBER_FACTORIES
|
||||
};
|
||||
|
@ -1056,12 +1050,8 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
#undef DXX_VALPTRIDX_MC_qualifier_c
|
||||
#undef DXX_VALPTRIDX_MC_qualifier_m
|
||||
|
||||
#define DXX_VALPTRIDX_DEFINE_FACTORY(MANAGED_TYPE, GLOBAL_FACTORY, GLOBAL_ARRAY, MEMBER_FACTORY) \
|
||||
__attribute_unused static auto &GLOBAL_FACTORY = GLOBAL_ARRAY.MEMBER_FACTORY; \
|
||||
using f ## GLOBAL_FACTORY = decltype(GLOBAL_FACTORY)
|
||||
__attribute_unused static auto &GLOBAL_FACTORY = GLOBAL_ARRAY.MEMBER_FACTORY
|
||||
|
||||
#define DXX_VALPTRIDX_DEFINE_GLOBAL_FACTORY(MANAGED_TYPE, DERIVED_TYPE_PREFIX, GLOBAL_ARRAY, PISUFFIX, IVPREFIX, MCPREFIX) \
|
||||
DXX_VALPTRIDX_DEFINE_FACTORY(MANAGED_TYPE, IVPREFIX ## MCPREFIX ## DERIVED_TYPE_PREFIX ## PISUFFIX, GLOBAL_ARRAY, IVPREFIX ## MCPREFIX ## PISUFFIX)
|
||||
|
|
Loading…
Reference in a new issue