12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #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;
- };
- 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();
- };
|