How to get fact data in C++

I need to get various bits of data from Facts in C++ for ultimate use in a QML file. Let’s say I need to get mahConsumed from the batteryFactGroup for use in a range estimation calculation. How am I supposed to do this in my script? There is 0 direction on this anywhere. Thanks.