add pause to PIBaseTransfer
need test git-svn-id: svn://db.shs.com.ru/pip@79 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -35,6 +35,8 @@ public:
|
||||
|
||||
bool isSending() const {return is_sending;}
|
||||
bool isReceiving() const {return is_receiving;}
|
||||
bool isPause() const {return is_pause;}
|
||||
void setPause(bool pause_);
|
||||
|
||||
void setPacketSize(int size) {packet_size = size;}
|
||||
int packetSize() const {return packet_size;}
|
||||
@@ -51,15 +53,19 @@ public:
|
||||
const PIDiagnostics &diagnostic() {return diag;}
|
||||
|
||||
EVENT(receiveStarted)
|
||||
EVENT(paused)
|
||||
EVENT(resumed)
|
||||
EVENT1(receiveFinished, bool, ok)
|
||||
EVENT(sendStarted)
|
||||
EVENT1(sendFinished, bool, ok)
|
||||
EVENT1(sendRequest, PIByteArray &, data)
|
||||
EVENT_HANDLER1(void, received, PIByteArray, data);
|
||||
EVENT_HANDLER(void, pause) {setPause(true);}
|
||||
EVENT_HANDLER(void, resume) {setPause(false);}
|
||||
|
||||
protected:
|
||||
uint packet_header_size, part_header_size;
|
||||
bool break_, is_sending, is_receiving;
|
||||
bool break_, is_sending, is_receiving, is_pause;
|
||||
PIString state_string;
|
||||
llong bytes_all, bytes_cur;
|
||||
|
||||
@@ -71,7 +77,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
enum PacketType {pt_Unknown, pt_Data, pt_ReplySuccess, pt_ReplyInvalid, pt_Break, pt_Start};
|
||||
enum PacketType {pt_Unknown, pt_Data, pt_ReplySuccess, pt_ReplyInvalid, pt_Break, pt_Start, pt_Pause};
|
||||
|
||||
# pragma pack(push,1)
|
||||
struct StartRequest {
|
||||
@@ -88,7 +94,7 @@ private:
|
||||
double timeout_;
|
||||
PIVector<PIVector<Part> > session;
|
||||
PIVector<PacketType> replies;
|
||||
PITimeMeasurer send_tm;
|
||||
PITimeMeasurer send_tm, pause_tm;
|
||||
PacketHeader header;
|
||||
CRC_16 crc;
|
||||
int replies_cnt, send_queue;
|
||||
|
||||
Reference in New Issue
Block a user