I need to implement an interface for a class in C++ where I need to ask for events occured related with two kinds of sets, let's say here persons and actions. I need to ask for person identifier and action identifier in all possible combinations (all of them, specifying only one of the identifiers or specifying both of them)
Option 1)
// Asks for all events occured for every combination
int getNumberofEvents(float param1)
// Asks for all events occured for idPerson AND all possible value of idAction
int getNumberofEvents(int idPerson, float param1)
// Asks for all events occured in idAction AND all possible value of idPerson
int getNumberofEvents(int idAction, float param1)
// Asks for all events occured in idPerson AND idAction
int getNumberofEvents(int idPerson, int idAction, float param1)
This option is clear to read but I need to implement a different interface for every possible combination, so there would be 8 methods if I include a new identifier (2³).
Option 2)
static const int ALL_PERSONS= 0;
static const int ALL_ACTIONS= 0;
int getNumberofEvents(int idPerson, int idAction, float param1)
For this option there is only one method interface, but I introduce a public magic number to search for 'All possible id'
Regarding to usability and further maintainability, which would be the best option between these two now I have in mind (there can be other better options that I do not include, of course).
Thanks.