git-svn-id: svn://db.shs.com.ru/pip@774 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -29,12 +29,20 @@
|
||||
|
||||
class PIIODevice;
|
||||
|
||||
class PIStreamPacker: public PIObject, public PIEthUtilBase {
|
||||
class PIP_EXPORT PIStreamPacker: public PIObject, public PIEthUtilBase {
|
||||
PIOBJECT(PIStreamPacker)
|
||||
public:
|
||||
//! Contructs packer and try to assign \"dev\"
|
||||
PIStreamPacker(PIIODevice * dev = 0);
|
||||
|
||||
struct Progress {
|
||||
Progress();
|
||||
bool active;
|
||||
int bytes_all;
|
||||
int bytes_current;
|
||||
double progress;
|
||||
};
|
||||
|
||||
//! Set maximum size of single packet
|
||||
void setMaxPacketSize(int max_size) {max_packet_size = max_size;}
|
||||
|
||||
@@ -61,6 +69,9 @@ public:
|
||||
//! and \a sendRequest() event to \"dev\" \a PIIODevice::write() handler
|
||||
void assignDevice(PIIODevice * dev);
|
||||
|
||||
Progress progressSend() const;
|
||||
Progress progressReceive() const;
|
||||
|
||||
EVENT1(packetReceiveEvent, PIByteArray, data)
|
||||
EVENT1(sendRequest, PIByteArray, data)
|
||||
|
||||
@@ -96,6 +107,8 @@ private:
|
||||
int packet_size;
|
||||
ushort packet_sign;
|
||||
int max_packet_size;
|
||||
Progress prog_s, prog_r;
|
||||
mutable PIMutex prog_s_mutex, prog_r_mutex;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user