This is a matter of style. Your example is probably more convenient to maintain, but the presence of individual types gives the advantage that they are independent - you can easily specialize, say, topic_data_reader for all types of pointers, but leave others unspecialized.
If you want to go deeper, I would question the lack of defaults:
namespace dds { template <typename Topic> struct topic_traits { typedef typename Topic::type_support type_support; typedef typename Topic::data_writer data_writer; typedef typename Topic::data_reader data_reader; typedef typename Topic::seq_type seq_type; }; }
This approach means that any class that provides the required typedefs is automatically qualified. The macro can still be used to generate these typedefs or class specializations, but this is probably not necessary ( seq_type , in particular, looks suspicious, as usual, a typedef, not a custom type).
EDIT: With a larger feature class, splitting things up can be used to reduce the number of instances required, but if your feature class contains elements in which using one of them probably means you are using the others, this is not good.
coppro
source share