diff --git a/doc/examples/piiodevice.cpp b/doc/examples/piiodevice.cpp index 0946dc16..c8ea515f 100644 --- a/doc/examples/piiodevice.cpp +++ b/doc/examples/piiodevice.cpp @@ -7,19 +7,19 @@ class SomeIO: public PIIODevice { public: SomeIO(): PIIODevice() {} protected: - bool openDevice() { + bool openDevice() override { // open your device here return if_success; } - int read(void * read_to, int max_size) { + int readDevice(void * read_to, int max_size) override { // read from your device here return readed_bytes; } - int write(const void * data, int max_size) { + int writeDevice(const void * data, int max_size) override { // write to your device here return written_bytes; } - void configureFromFullPath(const PIString & full_path) { + void configureFromFullPathDevice(const PIString & full_path) override { // parse full_path and configure device here } }; @@ -38,7 +38,7 @@ ser.configure("example.conf", "dev"); //! [configureDevice] class SomeIO: public PIIODevice { ... - bool configureDevice(const void * e_main, const void * e_parent) { + bool configureDevice(const void * e_main, const void * e_parent) override { PIConfig::Entry * em = (PIConfig::Entry * )e_main; PIConfig::Entry * ep = (PIConfig::Entry * )e_parent; setStringParam(readDeviceSetting("stringParam", stringParam(), em, ep)); diff --git a/libs/main/cloud/picloudclient.h b/libs/main/cloud/picloudclient.h index 4d21cb1d..4bd1276d 100644 --- a/libs/main/cloud/picloudclient.h +++ b/libs/main/cloud/picloudclient.h @@ -42,16 +42,17 @@ public: void setServerName(const PIString & server_name); void setKeepConnection(bool on); bool isConnected() const {return is_connected;} + ssize_t bytesAvailible() const override {return buff.size();} EVENT(connected); EVENT(disconnected); protected: - virtual bool openDevice() override; - virtual bool closeDevice() override; - virtual int readDevice(void * read_to, int max_size) override; - virtual int writeDevice(const void * data, int size) override; - virtual DeviceInfoFlags deviceInfoFlags() const override {return PIIODevice::Reliable;} + bool openDevice() override; + bool closeDevice() override; + int readDevice(void * read_to, int max_size) override; + int writeDevice(const void * data, int size) override; + DeviceInfoFlags deviceInfoFlags() const override {return PIIODevice::Reliable;} private: EVENT_HANDLER1(void, _readed, PIByteArray &, data); diff --git a/libs/main/cloud/picloudserver.h b/libs/main/cloud/picloudserver.h index 3936f0d3..4e3b7fd7 100644 --- a/libs/main/cloud/picloudserver.h +++ b/libs/main/cloud/picloudserver.h @@ -45,11 +45,12 @@ public: Client(PICloudServer * srv = nullptr, uint id = 0); virtual ~Client(); protected: - virtual bool openDevice() override; - virtual bool closeDevice() override; - virtual int readDevice(void * read_to, int max_size) override; - virtual int writeDevice(const void * data, int size) override; - virtual DeviceInfoFlags deviceInfoFlags() const override {return PIIODevice::Reliable;} + bool openDevice() override; + bool closeDevice() override; + int readDevice(void * read_to, int max_size) override; + int writeDevice(const void * data, int size) override; + DeviceInfoFlags deviceInfoFlags() const override {return PIIODevice::Reliable;} + ssize_t bytesAvailible() const override {return buff.size();} private: void pushBuffer(const PIByteArray & ba); @@ -68,10 +69,10 @@ public: EVENT1(newConnection, PICloudServer::Client * , client); protected: - virtual bool openDevice() override; - virtual bool closeDevice() override; - virtual int readDevice(void * read_to, int max_size) override; - virtual int writeDevice(const void * data, int max_size) override; + bool openDevice() override; + bool closeDevice() override; + int readDevice(void * read_to, int max_size) override; + int writeDevice(const void * data, int max_size) override; private: EVENT_HANDLER1(void, _readed, PIByteArray &, ba); diff --git a/libs/main/console/pikbdlistener.h b/libs/main/console/pikbdlistener.h index 9dcfca87..3dc32283 100644 --- a/libs/main/console/pikbdlistener.h +++ b/libs/main/console/pikbdlistener.h @@ -205,9 +205,9 @@ public: static PIKbdListener * instance() {return _object;} private: - void begin(); - void run() {readKeyboard();} - void end(); + void begin() override; + void run() override {readKeyboard();} + void end() override; #ifndef WINDOWS struct PIP_EXPORT EscSeq { diff --git a/libs/main/console/piscreen.h b/libs/main/console/piscreen.h index d590c56f..576cf232 100644 --- a/libs/main/console/piscreen.h +++ b/libs/main/console/piscreen.h @@ -134,9 +134,9 @@ private: PIVector > cells, pcells; }; - void begin(); - void run(); - void end(); + void begin() override; + void run() override; + void end() override; void key_event(PIKbdListener::KeyEvent key); EVENT_HANDLER1(void, mouse_event, PIKbdListener::MouseEvent, me); EVENT_HANDLER1(void, wheel_event, PIKbdListener::WheelEvent, we); @@ -145,9 +145,9 @@ private: PIVector prepareMouse(PIKbdListener::MouseEvent * e); PIVector tilesUnderMouse(int x, int y); bool nextFocus(PIScreenTile * rt, PIKbdListener::KeyEvent key = PIKbdListener::KeyEvent()); - void tileEventInternal(PIScreenTile * t, PIScreenTypes::TileEvent e); - void tileRemovedInternal(PIScreenTile * t); - void tileSetFocusInternal(PIScreenTile * t); + void tileEventInternal(PIScreenTile * t, PIScreenTypes::TileEvent e) override; + void tileRemovedInternal(PIScreenTile * t) override; + void tileSetFocusInternal(PIScreenTile * t) override; bool mouse_; SystemConsole console; diff --git a/libs/main/console/piscreenconsole.h b/libs/main/console/piscreenconsole.h index c650358d..60ddf9dc 100644 --- a/libs/main/console/piscreenconsole.h +++ b/libs/main/console/piscreenconsole.h @@ -64,8 +64,8 @@ protected: }; PIVector variables; PIScreenTypes::Alignment alignment; - void sizeHint(int & w, int & h) const; - void drawEvent(PIScreenDrawer * d); + void sizeHint(int & w, int & h) const override; + void drawEvent(PIScreenDrawer * d) override; }; diff --git a/libs/main/console/piscreentiles.h b/libs/main/console/piscreentiles.h index 5a03f58c..62f83929 100644 --- a/libs/main/console/piscreentiles.h +++ b/libs/main/console/piscreentiles.h @@ -40,8 +40,8 @@ public: PIVector content; PIScreenTypes::Alignment alignment; protected: - void sizeHint(int & w, int & h) const; - void drawEvent(PIScreenDrawer * d); + void sizeHint(int & w, int & h) const override; + void drawEvent(PIScreenDrawer * d) override; }; @@ -62,9 +62,9 @@ public: int thickness; protected: void _check(); - void sizeHint(int & w, int & h) const; - void drawEvent(PIScreenDrawer * d); - bool mouseEvent(PIKbdListener::MouseEvent me); + void sizeHint(int & w, int & h) const override; + void drawEvent(PIScreenDrawer * d) override; + bool mouseEvent(PIKbdListener::MouseEvent me) override; int minimum_, maximum_, value_; PIChar line_char; }; @@ -93,12 +93,12 @@ public: PISet selected; int lhei, cur, offset; protected: - void sizeHint(int & w, int & h) const; - void resizeEvent(int w, int h); - void drawEvent(PIScreenDrawer * d); - bool keyEvent(PIKbdListener::KeyEvent key); - bool mouseEvent(PIKbdListener::MouseEvent me); - bool wheelEvent(PIKbdListener::WheelEvent we); + void sizeHint(int & w, int & h) const override; + void resizeEvent(int w, int h) override; + void drawEvent(PIScreenDrawer * d) override; + bool keyEvent(PIKbdListener::KeyEvent key) override; + bool mouseEvent(PIKbdListener::MouseEvent me) override; + bool wheelEvent(PIKbdListener::WheelEvent we) override; TileScrollBar * scroll; bool mouse_sel; }; @@ -115,10 +115,10 @@ public: PIScreenTypes::CellFormat format; PIString text; protected: - void sizeHint(int & w, int & h) const; - void drawEvent(PIScreenDrawer * d); - bool keyEvent(PIKbdListener::KeyEvent key); - bool mouseEvent(PIKbdListener::MouseEvent me); + void sizeHint(int & w, int & h) const override; + void drawEvent(PIScreenDrawer * d) override; + bool keyEvent(PIKbdListener::KeyEvent key) override; + bool mouseEvent(PIKbdListener::MouseEvent me) override; }; @@ -137,10 +137,10 @@ public: PIVector