How to get value from protected class

Hello,
I'm working on optical sensor from a mouse. I plugged my mouse into USB shield. I want to have in my serial port shown dX, X , dy , Y. dx and dy is latest displacement and X and Y sum of it. I have the problem with the protected class. I cannot get this information from this class. I know that in C# I should use set and get contractors, but I don't know how to do it now. Bew is my code

#include <hidboot.h>
#include <usbhub.h>

#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>

class MouseRptParser : public MouseReportParser
{
protected:
 void OnMouseMove (MOUSEINFO *mi);
};

void MouseRptParser::OnMouseMove(MOUSEINFO *mi)
{
    Serial.print("dx=");
    Serial.print(mi ->dX, DEC);
    Serial.print("X=");
    Serial.print(" dy=");
    Serial.println(mi ->dY, DEC);
    Serial.print("Y=");
    
};
USB     Usb;
USBHub     Hub(&Usb);
HIDBoot<USB_HID_PROTOCOL_MOUSE>    HidMouse(&Usb);

MouseRptParser Prs;

void setup()
{
  global X,Y = 0;
    Serial.begin( 115200 );
#if !defined(__MIPSEL__)
    while (!Serial); 
#endif
    Serial.println("Start");

    if (Usb.Init() == -1)
        Serial.println("OSC did not start.");
    delay( 200 );
 
    HidMouse.SetReportParser(0, &Prs);
}

void loop()
{  
  Usb.Task();
}

If it is protected in the original class and there are no public set and get messages then you cannot do it.

The easiest way is to edit the class to move those variables into the public section. The class won't know that its underwear is showing.

Other options such as friend classes are also possible.

Do X and Y even exist?

struct MOUSEINFO {

        struct {
                uint8_t bmLeftButton : 1;
                uint8_t bmRightButton : 1;
                uint8_t bmMiddleButton : 1;
                uint8_t bmDummy : 5;
        };
        int8_t dX;
        int8_t dY;
};