1st option is to use an array of function pointers.
static void (*functionArray[30])(SomeClass *) = {
Function1,
Function2,
Function3,
Function4
//
};
static void CallFunction(SomeClass *objectToCallFunctionOn, int functionToCall) {
functionArray[functionToCall](objectToCallFunctionOn);
}
Another option will be to do the same thing with non-type template parameters. But I think the first option solves the issue fairly.