Ignore:
Timestamp:
Jan 9, 2017, 11:09:38 AM (2 years ago)
Author:
jrpelegrina
Message:

Update new version: 3.15.02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • filezilla/trunk/fuentes/src/engine/iothread.h

    r130 r3185  
    22#define __IOTHREAD_H__
    33
    4 #include <wx/file.h>
    5 #include "event_loop.h"
     4#include <libfilezilla/event.hpp>
    65
    76#define BUFFERCOUNT 5
     
    1413
    1514struct io_thread_event_type{};
    16 typedef CEvent<io_thread_event_type> CIOThreadEvent;
     15typedef fz::simple_event<io_thread_event_type> CIOThreadEvent;
    1716
    1817enum IORet
     
    2322};
    2423
    25 class CFile;
    26 class CIOThread final : protected wxThread
     24namespace fz {
     25class file;
     26}
     27
     28class CIOThread final : protected fz::thread
    2729{
    2830public:
     
    3032        virtual ~CIOThread();
    3133
    32         bool Create(std::unique_ptr<CFile> && pFile, bool read, bool binary);
     34        bool Create(std::unique_ptr<fz::file> && pFile, bool read, bool binary);
    3335        virtual void Destroy(); // Only call that might be blocking
    3436
     
    3739        // get triggerd iff a buffer is available after a call to the
    3840        // GetNext*Buffer functions returned IO_Again
    39         void SetEventHandler(CEventHandler* handler);
     41        void SetEventHandler(fz::event_handler* handler);
    4042
    4143        // Gets next buffer
     
    5658        wxString GetError();
    5759
    58 protected:
     60private:
    5961        void Close();
    6062
    61         virtual ExitCode Entry();
     63        virtual void entry();
    6264
    63         int ReadFromFile(char* pBuffer, int maxLen);
    64         bool WriteToFile(char* pBuffer, int len);
    65         bool DoWrite(const char* pBuffer, int len);
     65        int64_t ReadFromFile(char* pBuffer, int64_t maxLen);
     66        bool WriteToFile(char* pBuffer, int64_t len);
     67        bool DoWrite(const char* pBuffer, int64_t len);
    6668
    67         CEventHandler* m_evtHandler{};
     69        fz::event_handler* m_evtHandler{};
    6870
    6971        bool m_read{};
    7072        bool m_binary{};
    71         std::unique_ptr<CFile> m_pFile;
     73        std::unique_ptr<fz::file> m_pFile;
    7274
    7375        char* m_buffers[BUFFERCOUNT];
    7476        unsigned int m_bufferLens[BUFFERCOUNT];
    7577
    76         mutex m_mutex;
    77         condition m_condition;
     78        fz::mutex m_mutex;
     79        fz::condition m_condition;
    7880
    7981        int m_curAppBuf{};
     
    8587        bool m_appWaiting{};
    8688
    87         bool m_destroyed{};
    88 
    8989        bool m_wasCarriageReturn{};
    9090
     
    9292
    9393#ifdef SIMULATE_IO
    94         wxFileOffset size_{};
     94        int64_t size_{};
    9595#endif
    9696};
Note: See TracChangeset for help on using the changeset viewer.