123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #pragma once
- #include "../../Netzwerk/Patcher.h"
- #include <Fortschritt.h>
- #include <Knopf.h>
- #include <Array.h>
- #include <Thread.h>
- using namespace Framework;
- class Update : public Thread
- {
- private:
- Patcher *p;
- FBalken *fb;
- bool updateAbbrechen;
- int dg;
- std::function< void(bool) > after;
- public:
-
- Update( Schrift *zSchrift, FBalken *fb, int dg, std::function< void(bool) > after = [](bool b){} );
-
- ~Update();
-
- void setPatcher( Patcher *p );
- void abbrechen();
- void herunterladen();
- void thread() override;
- void threadEnd() override;
-
- int getDateiGruppe() const;
-
- Thread *release() override;
- };
- class UpdateHandler
- {
- private:
- Patcher *patcher;
- RCArray< Update > *updates;
- Critical cs;
- int ref;
-
- void lock();
- void unlock();
- public:
-
- UpdateHandler();
-
- ~UpdateHandler();
-
- bool add( Update *update );
- void remove( int dg = 0 );
- bool hat( int dg = 0 );
-
- UpdateHandler *getThis();
- UpdateHandler *release();
- };
|