Using macros, I've created lots of very similar matrix and vector structs (i.e: Vec1i
, Vec1f
, Vec2i
etc.), but I'm not sure how I should document them without copy/pasting the same comment for every single struct and replacing the type and size. For example:
#define CREATE_VECTOR(TYPE, TYPE_NAME, NUM_DIMENSIONS)\
struct vec ## NUM_DIMENSIONS ## TYPE_NAME\
{\
TYPE data[NUM_DIMENSIONS];\
};\
typedef struct vec ## NUM_DIMENSIONS ## TYPE_NAME Vec ## NUM_DIMENSIONS ## TYPE_NAME;
#define CREATE_MATRIX(TYPE, TYPE_NAME, ROWS, COLUMNS)\
struct mat ## ROWS ## x ## COLUMNS ## TYPE_NAME\
{\
TYPE data[ROWS][COLUMNS];\
};\
typedef struct mat ## ROWS ## x ## COLUMNS ## TYPE_NAME Mat ## ROWS ## x ## COLUMNS ## TYPE_NAME;
The problem with this is that I still have to write the documentation for every vector/matrix I create:
////////////////////////////////////////////////////////////////
/// \struct Vec3i
///
/// \brief *my description*
///
/// \var Vec3i::data
///
/// \brief *member description*
///
////////////////////////////////////////////////////////////////
CREATE_VECTOR(int, i, 3);
Is it possible to document a whole collection of structs, or have doxygen automatically generate documentation for every version of the vector/matrix?