cgma
|
Convenience macros for iterating over all possible values in an enum. More...
#define | IBASE_MINENUM(enumName) enumName ## _MIN |
#define | IBASE_MAXENUM(enumName) enumName ## _MAX |
#define | IBASE_NUMENUM(enumName) ((int)IBASE_MAXENUM(enumName) - (int)IBASE_MINENUM(enumName) + 1) |
#define | IBASE_INCENUM(enumName, I) (I = (enum enumName)((int)I+1)) |
Convenience macros for iterating over all possible values in an enum.
These convenience macros are provided to facilitate iterating over all possible values in an enumerated type. To use these macros, for example...
for (iBase_EntityType i = IBASE_MINENUM(iBase_EntityType); i <= IBASE_MAXENUM(iBase_EntityType); IBASE_INCENUM(i,iBase_EntityType)) { }
Be aware that some enumerated types include a wild card often used in queries to represent all possible values and you may or may not want to include such a value in your iteration.
#define IBASE_INCENUM | ( | enumName, | |
I | |||
) | (I = (enum enumName)((int)I+1)) |
#define IBASE_MAXENUM | ( | enumName | ) | enumName ## _MAX |
#define IBASE_MINENUM | ( | enumName | ) | enumName ## _MIN |
#define IBASE_NUMENUM | ( | enumName | ) | ((int)IBASE_MAXENUM(enumName) - (int)IBASE_MINENUM(enumName) + 1) |