1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-07-08 03:58:43 +00:00

Add override keyword to all virtual override functions

This commit is contained in:
cathery 2019-11-13 14:27:43 +03:00
parent c2c58971a7
commit d9b2b59989
13 changed files with 73 additions and 73 deletions

View File

@ -130,19 +130,19 @@ private:
public: public:
Dualshock3Controller(std::unique_ptr<IUSBDevice> &&interface); Dualshock3Controller(std::unique_ptr<IUSBDevice> &&interface);
virtual ~Dualshock3Controller(); virtual ~Dualshock3Controller() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual Result GetInput(); virtual Result GetInput() override;
virtual NormalizedButtonData GetNormalizedButtonData(); virtual NormalizedButtonData GetNormalizedButtonData() override;
virtual ControllerType GetType() { return CONTROLLER_DUALSHOCK3; } virtual ControllerType GetType() override { return CONTROLLER_DUALSHOCK3; }
inline const Dualshock3ButtonData &GetButtonData() { return m_buttonData; }; inline const Dualshock3ButtonData &GetButtonData() { return m_buttonData; };
@ -157,5 +157,5 @@ public:
Result SetLED(Dualshock3LEDValue value); Result SetLED(Dualshock3LEDValue value);
static void LoadConfig(const ControllerConfig *config); static void LoadConfig(const ControllerConfig *config);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
}; };

View File

@ -111,19 +111,19 @@ private:
public: public:
Dualshock4Controller(std::unique_ptr<IUSBDevice> &&interface); Dualshock4Controller(std::unique_ptr<IUSBDevice> &&interface);
virtual ~Dualshock4Controller(); virtual ~Dualshock4Controller() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual Result GetInput(); virtual Result GetInput() override;
virtual NormalizedButtonData GetNormalizedButtonData(); virtual NormalizedButtonData GetNormalizedButtonData() override;
virtual ControllerType GetType() { return CONTROLLER_DUALSHOCK4; } virtual ControllerType GetType() override { return CONTROLLER_DUALSHOCK4; }
inline const Dualshock4USBButtonData &GetButtonData() { return m_buttonData; }; inline const Dualshock4USBButtonData &GetButtonData() { return m_buttonData; };
@ -134,5 +134,5 @@ public:
Result SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude); Result SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
static void LoadConfig(const ControllerConfig *config); static void LoadConfig(const ControllerConfig *config);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
}; };

View File

@ -90,19 +90,19 @@ private:
public: public:
Xbox360Controller(std::unique_ptr<IUSBDevice> &&interface); Xbox360Controller(std::unique_ptr<IUSBDevice> &&interface);
virtual ~Xbox360Controller(); virtual ~Xbox360Controller() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual Result GetInput(); virtual Result GetInput() override;
virtual NormalizedButtonData GetNormalizedButtonData(); virtual NormalizedButtonData GetNormalizedButtonData() override;
virtual ControllerType GetType() { return CONTROLLER_XBOX360; } virtual ControllerType GetType() override { return CONTROLLER_XBOX360; }
inline const Xbox360ButtonData &GetButtonData() { return m_buttonData; }; inline const Xbox360ButtonData &GetButtonData() { return m_buttonData; };
@ -115,5 +115,5 @@ public:
Result SetLED(Xbox360LEDValue value); Result SetLED(Xbox360LEDValue value);
static void LoadConfig(const ControllerConfig *config); static void LoadConfig(const ControllerConfig *config);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
}; };

View File

@ -26,19 +26,19 @@ private:
public: public:
Xbox360WirelessController(std::unique_ptr<IUSBDevice> &&interface); Xbox360WirelessController(std::unique_ptr<IUSBDevice> &&interface);
virtual ~Xbox360WirelessController(); virtual ~Xbox360WirelessController() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual Result GetInput(); virtual Result GetInput() override;
virtual NormalizedButtonData GetNormalizedButtonData(); virtual NormalizedButtonData GetNormalizedButtonData() override;
virtual ControllerType GetType() { return CONTROLLER_XBOX360W; } virtual ControllerType GetType() override { return CONTROLLER_XBOX360W; }
inline const Xbox360ButtonData &GetButtonData() { return m_buttonData; }; inline const Xbox360ButtonData &GetButtonData() { return m_buttonData; };
@ -52,11 +52,11 @@ public:
Result OnControllerDisconnect(); Result OnControllerDisconnect();
static void LoadConfig(const ControllerConfig *config); static void LoadConfig(const ControllerConfig *config);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
Result WriteToEndpoint(const uint8_t *buffer, size_t size); Result WriteToEndpoint(const uint8_t *buffer, size_t size);
virtual Result OutputBuffer(); virtual Result OutputBuffer() override;
bool IsControllerActive() override { return m_presence; } bool IsControllerActive() override { return m_presence; }
}; };

View File

@ -60,19 +60,19 @@ private:
public: public:
XboxController(std::unique_ptr<IUSBDevice> &&interface); XboxController(std::unique_ptr<IUSBDevice> &&interface);
virtual ~XboxController(); virtual ~XboxController() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual Result GetInput(); virtual Result GetInput() override;
virtual NormalizedButtonData GetNormalizedButtonData(); virtual NormalizedButtonData GetNormalizedButtonData() override;
virtual ControllerType GetType() { return CONTROLLER_XBOX360; } virtual ControllerType GetType() override { return CONTROLLER_XBOX360; }
inline const XboxButtonData &GetButtonData() { return m_buttonData; }; inline const XboxButtonData &GetButtonData() { return m_buttonData; };
@ -82,5 +82,5 @@ public:
Result SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude); Result SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
static void LoadConfig(const ControllerConfig *config); static void LoadConfig(const ControllerConfig *config);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
}; };

View File

@ -29,20 +29,20 @@ private:
public: public:
XboxOneAdapter(std::unique_ptr<IUSBDevice> &&interface); XboxOneAdapter(std::unique_ptr<IUSBDevice> &&interface);
virtual ~XboxOneAdapter(); virtual ~XboxOneAdapter() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual ControllerType GetType() { return CONTROLLER_XBOXONEW; } virtual ControllerType GetType() override { return CONTROLLER_XBOXONEW; }
Result LoadFirmwarePart(uint32_t offset, uint8_t *start, uint8_t *end); Result LoadFirmwarePart(uint32_t offset, uint8_t *start, uint8_t *end);
Result SendInitBytes(); Result SendInitBytes();
Result ControlWrite(IUSBInterface *interface, uint16_t address, uint32_t value, VendorRequest request = MT_VEND_MULTI_WRITE); Result ControlWrite(IUSBInterface *interface, uint16_t address, uint32_t value, VendorRequest request = MT_VEND_MULTI_WRITE);
static void LoadConfig(const ControllerConfig *config, const char *path); static void LoadConfig(const ControllerConfig *config, const char *path);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
}; };

View File

@ -83,19 +83,19 @@ private:
public: public:
XboxOneController(std::unique_ptr<IUSBDevice> &&interface); XboxOneController(std::unique_ptr<IUSBDevice> &&interface);
virtual ~XboxOneController(); virtual ~XboxOneController() override;
virtual Result Initialize(); virtual Result Initialize() override;
virtual void Exit(); virtual void Exit() override;
Result OpenInterfaces(); Result OpenInterfaces();
void CloseInterfaces(); void CloseInterfaces();
virtual Result GetInput(); virtual Result GetInput() override;
virtual NormalizedButtonData GetNormalizedButtonData(); virtual NormalizedButtonData GetNormalizedButtonData() override;
virtual ControllerType GetType() { return CONTROLLER_XBOXONE; } virtual ControllerType GetType() override { return CONTROLLER_XBOXONE; }
inline const XboxOneButtonData &GetButtonData() { return m_buttonData; }; inline const XboxOneButtonData &GetButtonData() { return m_buttonData; };
@ -107,5 +107,5 @@ public:
Result SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude); Result SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
static void LoadConfig(const ControllerConfig *config); static void LoadConfig(const ControllerConfig *config);
virtual ControllerConfig *GetConfig(); virtual ControllerConfig *GetConfig() override;
}; };

View File

@ -26,8 +26,8 @@ public:
virtual Result ControlTransfer(uint8_t bmRequestType, uint8_t bmRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, void *buffer) = 0; virtual Result ControlTransfer(uint8_t bmRequestType, uint8_t bmRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, void *buffer) = 0;
virtual IUSBEndpoint *GetEndpoint(IUSBEndpoint::Direction direction, uint8_t index); virtual IUSBEndpoint *GetEndpoint(IUSBEndpoint::Direction direction, uint8_t index) = 0;
virtual InterfaceDescriptor *GetDescriptor(); virtual InterfaceDescriptor *GetDescriptor() = 0;
virtual Result Reset() = 0; virtual Result Reset() = 0;
}; };

View File

@ -18,13 +18,13 @@ public:
~SwitchAbstractedPadHandler(); ~SwitchAbstractedPadHandler();
//Initialize controller handler, AbstractedPadState //Initialize controller handler, AbstractedPadState
Result Initialize() override; virtual Result Initialize() override;
void Exit() override; virtual void Exit() override;
//This will be called periodically by the input threads //This will be called periodically by the input threads
void UpdateInput() override; virtual void UpdateInput() override;
//This will be called periodically by the output threads //This will be called periodically by the output threads
void UpdateOutput() override; virtual void UpdateOutput() override;
//Separately init and close the HDL state //Separately init and close the HDL state
Result InitAbstractedPadState(); Result InitAbstractedPadState();

View File

@ -19,13 +19,13 @@ public:
~SwitchHDLHandler(); ~SwitchHDLHandler();
//Initialize controller handler, HDL state //Initialize controller handler, HDL state
Result Initialize() override; virtual Result Initialize() override;
void Exit() override; virtual void Exit() override;
//This will be called periodically by the input threads //This will be called periodically by the input threads
void UpdateInput() override; virtual void UpdateInput() override;
//This will be called periodically by the output threads //This will be called periodically by the output threads
void UpdateOutput() override; virtual void UpdateOutput() override;
//Separately init and close the HDL state //Separately init and close the HDL state
Result InitHdlState(); Result InitHdlState();

View File

@ -14,12 +14,12 @@ public:
SwitchUSBDevice(UsbHsInterface *interfaces, int length); SwitchUSBDevice(UsbHsInterface *interfaces, int length);
//There are no devices to open on the switch, so instead this returns success if there are any interfaces //There are no devices to open on the switch, so instead this returns success if there are any interfaces
virtual Result Open(); virtual Result Open() override;
//Closes all the interfaces associated with the class //Closes all the interfaces associated with the class
virtual void Close(); virtual void Close() override;
// Resets the device // Resets the device
virtual void Reset(); virtual void Reset() override;
//Create interfaces from the given array of specified element length //Create interfaces from the given array of specified element length
void SetInterfaces(UsbHsInterface *interfaces, int length); void SetInterfaces(UsbHsInterface *interfaces, int length);

View File

@ -16,20 +16,20 @@ public:
~SwitchUSBEndpoint(); ~SwitchUSBEndpoint();
//Open and close the endpoint //Open and close the endpoint
virtual Result Open(int maxPacketSize = 0); virtual Result Open(int maxPacketSize = 0) override;
virtual void Close(); virtual void Close() override;
//buffer should point to the data array, and only the specified size will be read. //buffer should point to the data array, and only the specified size will be read.
virtual Result Write(const void *inBuffer, size_t bufferSize); virtual Result Write(const void *inBuffer, size_t bufferSize) override;
//The data received will be put in the outBuffer array for the length of the specified size. //The data received will be put in the outBuffer array for the length of the specified size.
virtual Result Read(void *outBuffer, size_t bufferSize); virtual Result Read(void *outBuffer, size_t bufferSize) override;
//Gets the direction of this endpoint (IN or OUT) //Gets the direction of this endpoint (IN or OUT)
virtual IUSBEndpoint::Direction GetDirection(); virtual IUSBEndpoint::Direction GetDirection() override;
//get the endpoint descriptor //get the endpoint descriptor
virtual IUSBEndpoint::EndpointDescriptor *GetDescriptor(); virtual IUSBEndpoint::EndpointDescriptor *GetDescriptor() override;
// Get the current EpSession (after it was opened) // Get the current EpSession (after it was opened)
inline UsbHsClientEpSession &GetSession() { return m_epSession; } inline UsbHsClientEpSession &GetSession() { return m_epSession; }

View File

@ -19,16 +19,16 @@ public:
~SwitchUSBInterface(); ~SwitchUSBInterface();
// Open and close the interface // Open and close the interface
virtual Result Open(); virtual Result Open() override;
virtual void Close(); virtual void Close() override;
virtual Result ControlTransfer(u8 bmRequestType, u8 bmRequest, u16 wValue, u16 wIndex, u16 wLength, void *buffer); virtual Result ControlTransfer(u8 bmRequestType, u8 bmRequest, u16 wValue, u16 wIndex, u16 wLength, void *buffer) override;
// There are a total of 15 endpoints on a switch interface for each direction, get them by passing the desired parameters // There are a total of 15 endpoints on a switch interface for each direction, get them by passing the desired parameters
virtual IUSBEndpoint *GetEndpoint(IUSBEndpoint::Direction direction, uint8_t index); virtual IUSBEndpoint *GetEndpoint(IUSBEndpoint::Direction direction, uint8_t index) override;
// Reset the device // Reset the device
virtual Result Reset(); virtual Result Reset() override;
//Get the unique session ID for this interface //Get the unique session ID for this interface
inline s32 GetID() { return m_session.ID; } inline s32 GetID() { return m_session.ID; }
@ -37,5 +37,5 @@ public:
//Get the raw session //Get the raw session
inline UsbHsClientIfSession &GetSession() { return m_session; } inline UsbHsClientIfSession &GetSession() { return m_session; }
virtual InterfaceDescriptor *GetDescriptor() { return reinterpret_cast<InterfaceDescriptor *>(&m_interface.inf.interface_desc); } virtual InterfaceDescriptor *GetDescriptor() override { return reinterpret_cast<InterfaceDescriptor *>(&m_interface.inf.interface_desc); }
}; };