Currently, with the way the API works, you need to know the string name of the endpoint in xspd. I.e. to get something like beam energy, you do:
float beamEnergy = pDetector->GetVar<float>("beam_energy");
It would be nicer/more user-friendly if this looked more like:
float beamEnergy = pDetector->GetVar<XSPD::BeamEnergy>();
The type deduction could be done via template structs, and that way you'd get a compile error if your type is incorrect, instead of a runtime error like you do now.
Currently, with the way the API works, you need to know the string name of the endpoint in
xspd. I.e. to get something like beam energy, you do:It would be nicer/more user-friendly if this looked more like:
The type deduction could be done via template structs, and that way you'd get a compile error if your type is incorrect, instead of a runtime error like you do now.