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