Instantating a class - I think?


Looking at the example DS3231_Simple.ino from the “Rtc by Makuna” library, I see this code:

16 /* for normal hardware wire use below */
17 #include <Wire.h> // must be included here so that Arduino library object file references work
18 #include <RtcDS3231.h>
19 RtcDS3231 <TwoWire> Rtc(Wire);
20 /* for normal hardware wire use above */

Would anyone mind talking me through what is happening at line 19?
I guess that we are instantiating a new object of class: RtcDS3231? But what is happening with the following two expressions?

Regards, ~M

read about Class templates

[color=red]RtcDS3231[/color] <[color=blue]TwoWire[/color]> [color=green]Rtc[/color]([color=purple]Wire[/color]);

you have a “templatized” class [color=red]RtcDS3231[/color]
The type to use for the template is TwoWire
the name of the instance you create is


and the constructor for that class takes a parameter which is [color=purple]Wire[/color]

EDIT: actually found some documentation here directly in the github