threadedRead now const uchar *

pipacketextractor Header mode now more flexible
fix splitTime mode
more refactoring
add virtual override to functions
remove piforeach
replace 0 to nullptr
iterate over pimap via iterators
replace CONNECTU to CONNECT# with compile time check
This commit is contained in:
Бычков Андрей
2022-07-26 17:18:08 +03:00
parent a4882dc054
commit d13e68c206
36 changed files with 615 additions and 623 deletions

View File

@@ -216,7 +216,7 @@ public:
//! \~english Discard all buffered input and output data
//! \~russian Откидывает все буферизированные данные для передачи и приема
void flush();
virtual void flush() override;
int read(void * read_to, int max_size) {return readDevice(read_to, max_size);}
@@ -282,19 +282,19 @@ public:
//! \}
protected:
PIString constructFullPathDevice() const;
void configureFromFullPathDevice(const PIString & full_path);
PIPropertyStorage constructVariantDevice() const;
void configureFromVariantDevice(const PIPropertyStorage & d);
bool configureDevice(const void * e_main, const void * e_parent = 0);
void optionsChanged();
void threadedReadBufferSizeChanged();
virtual PIString constructFullPathDevice() const override;
virtual void configureFromFullPathDevice(const PIString & full_path) override;
virtual PIPropertyStorage constructVariantDevice() const override;
virtual void configureFromVariantDevice(const PIPropertyStorage & d) override;
virtual bool configureDevice(const void * e_main, const void * e_parent = 0) override;
virtual void optionsChanged() override;
virtual void threadedReadBufferSizeChanged() override;
//! \~english Basic read function
//! \~russian Базовое чтение
int readDevice(void * read_to, int max_size);
int writeDevice(const void * data, int max_size);
DeviceInfoFlags deviceInfoFlags() const {return PIIODevice::Sequential;}
virtual int readDevice(void * read_to, int max_size) override;
virtual int writeDevice(const void * data, int max_size) override;
virtual DeviceInfoFlags deviceInfoFlags() const override {return PIIODevice::Sequential;}
//! Executes when any read function was successful. Default implementation does nothing
virtual void received(const void * data, int size) {;}
@@ -306,8 +306,8 @@ protected:
bool setBit(int bit, bool on, const PIString & bname);
bool isBit(int bit, const PIString & bname) const;
bool openDevice();
bool closeDevice();
virtual bool openDevice() override;
virtual bool closeDevice() override;
PRIVATE_DECLARATION(PIP_EXPORT)
int fd, vtime;