Arguments to function in AlarmTime library

I am developing a sketch in which I can have up to 50 alarms at the same time. I have checked the example of how timeAlarm library works and I see I have to pass a function as an argument to fire it each time an alarm gets its time.

Alarm.alarmRepeat(17,45,0,functionAlarm);

I would want to pass also an identifier or something like that. In my sketch, there is an array with 10 elements and each element can have up to 5 alarms. Each one of the first 10 elements does a diferent thing. Is it possible to specify a number as parameter instead of creating 10 functions and handle from them?

function1(){
functionAlarm(1);
}
function2(){
functionAlarm(2);
}
.
.
.

I would want to do something like:

Alarm.alarmRepeat(17,45,0,functionAlarm, array_position);

I think this would be a worse solution. But if I have to other way to solve it I will have to do it.

This is an interesting question. There is such a thing as a pointer to a function, and you can also have an array of pointers to functions. There was a thread about them, a couple of days ago. The concept is rather obscure and I have never used one.

If I was doing your project, I'd probably do the whole thing another way. Or, modify the library to add an additional function which does exactly what you want.

Function pointers:

I'm not if I am looking at the same TimeAlarms class that you are trying to use [ or AlarmTime ??? ].

What I would do is add another int class member to the AlarmClass class, add another 1 or more methods which enable that class member to be initialized when setting the alarm, add an additional callback type in addition to the OnTick_t typedef already there, for a class of callback functions which take an int parameter, and the call those callbck functions with the int parameter which the user ( you ) specified.

michinyon:
I'm not if I am looking at the same TimeAlarms class that you are trying to use [ or AlarmTime ??? ].

What I would do is add another int class member to the AlarmClass class, add another 1 or more methods which enable that class member to be initialized when setting the alarm, add an additional callback type in addition to the OnTick_t typedef already there, for a class of callback functions which take an int parameter, and the call those callbck functions with the int parameter which the user ( you ) specified.

I will try to do what you said.

Also I will check LarryD link. I found it quite interesting in a fast read.

Thanks both. I will post in case I make it or not to tell you what I find.

I am developing a sketch in which I can have up to 50 alarms at the same time.

Before you do anything else if you have not already done it look at the TimeAlarms readme to see how to increase the number of alarms that can be created and consider the implications in terms of memory.

UKHeliBob:
Before you do anything else if you have not already done it look at the TimeAlarms readme to see how to increase the number of alarms that can be created and consider the implications in terms of memory.

Dammit. I haven't think about it. I will do. I just tried a couple of hours what I asked but I didn't get anything to work. I will try next weekend but tonight I will check documentation.
Thanks for suggestion.